@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Ultralight.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #181A10;
    --bg-2: #21231A;
    --bg-card: rgba(28, 30, 18, 0.92);
    --bg-card-hover: rgba(36, 38, 24, 0.98);

    --gold-1: #8F6538;
    --gold-2: #9F7F44;
    --gold-3: #C3C26E;
    --gold-4: #E2EAA2;
    --gold-text: #D6C181;

    --cream: #F3EDDF;
    --cream-muted: rgba(243, 237, 223, 0.55);
    --olive: #656950;
    --olive-dark: #3F4230;

    --border-gold: rgba(195, 194, 110, 0.18);
    --border-gold-hover: rgba(195, 194, 110, 0.45);

    --color-aberto: #D4A843;
    --color-producao: #7EB8D9;
    --color-pronto: #90C976;
    --color-enviado: #6BAEAD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 5% 5%, rgba(143, 101, 56, 0.09) 0%, transparent 45%),
        radial-gradient(ellipse at 95% 95%, rgba(101, 105, 80, 0.11) 0%, transparent 45%);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background ornaments */
.bg-ornament {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
    pointer-events: none;
}

.ornament-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(143, 101, 56, 0.13) 0%, transparent 70%);
    top: -120px; left: -160px;
    animation: driftSlow 28s infinite alternate ease-in-out;
}

.ornament-2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(101, 105, 80, 0.11) 0%, transparent 70%);
    bottom: -100px; right: -120px;
    animation: driftSlow 32s infinite alternate-reverse ease-in-out;
}

.ornament-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(195, 194, 110, 0.07) 0%, transparent 70%);
    top: 48%; left: 44%;
    animation: driftSlow 22s infinite alternate ease-in-out;
    animation-delay: -9s;
}

@keyframes driftSlow {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(45px, 35px); }
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 52px 42px;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 48px;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand-logo-img {
    height: 140px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(195, 194, 110, 0.25));
    transition: filter 0.3s ease;
}

.brand-logo-img:hover {
    filter: drop-shadow(0 0 22px rgba(195, 194, 110, 0.5));
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-title {
    font-family: 'PP Hatton', serif;
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #8F6538 0%, #C3C26E 50%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(24, 26, 16, 0.85);
    padding: 14px 24px;
    border-radius: 32px;
    border: 1px solid var(--border-gold);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.status-label {
    font-size: 0.7rem;
    color: var(--gold-text);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 3px;
}

.status-time {
    font-size: 0.88rem;
    color: var(--cream-muted);
}

.status-time strong {
    color: var(--cream);
    font-weight: 500;
}

/* Pulse dots */
.pulse-dot {
    width: 10px; height: 10px;
    background-color: var(--color-enviado);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseBlue 2s infinite;
}

.pulse-dot-gold {
    background-color: var(--gold-3);
    animation: pulseGold 2s infinite;
}

@keyframes pulseBlue {
    0%   { box-shadow: 0 0 0 0 rgba(107, 174, 173, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(107, 174, 173, 0); }
    100% { box-shadow: 0 0 0 0 rgba(107, 174, 173, 0); }
}

@keyframes pulseGold {
    0%   { box-shadow: 0 0 0 0 rgba(195, 194, 110, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(195, 194, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(195, 194, 110, 0); }
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 52px;
    opacity: 0.45;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}

.divider-ornament {
    font-size: 0.85rem;
    color: var(--gold-3);
    flex-shrink: 0;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
    gap: 24px;
    margin-bottom: 52px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 38px 34px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card::before { display: none; }

.card-glow {
    position: absolute;
    top: -30px; right: -30px;
    width: 140px; height: 140px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: blur(36px);
    pointer-events: none;
}

.card-aberto  .card-glow { background: var(--color-aberto); }
.card-producao .card-glow { background: var(--color-producao); }
.card-pronto  .card-glow { background: var(--color-pronto); }
.card-enviado .card-glow { background: var(--color-enviado); }

.card:hover {
    transform: translateY(-12px);
    border-color: var(--border-gold-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45);
}

.card:hover .card-glow { opacity: 0.1; }

.card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 26px;
    border: 1px solid;
    transition: transform 0.3s ease;
}

.card:hover .card-icon { transform: scale(1.05) rotate(-3deg); }

.card-icon svg { width: 26px; height: 26px; }

.card-aberto  .card-icon { background: rgba(212, 168, 67, 0.10); color: var(--color-aberto);   border-color: rgba(212, 168, 67,  0.25); }
.card-producao .card-icon { background: rgba(126, 184, 217, 0.10); color: var(--color-producao); border-color: rgba(126, 184, 217, 0.25); }
.card-pronto  .card-icon { background: rgba(144, 201, 118, 0.10); color: var(--color-pronto);   border-color: rgba(144, 201, 118, 0.25); }
.card-enviado .card-icon { background: rgba(107, 174, 173, 0.10); color: var(--color-enviado);  border-color: rgba(107, 174, 173, 0.25); }

.card h3 {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-muted);
    margin-bottom: 12px;
}

.number {
    font-family: 'PP Hatton', serif;
    font-size: 5.2rem;
    font-weight: 300;
    line-height: 1;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.card-aberto  .number { color: var(--color-aberto);   text-shadow: 0 0 22px rgba(212, 168, 67,  0.3); }
.card-producao .number { color: var(--color-producao); text-shadow: 0 0 22px rgba(126, 184, 217, 0.3); }
.card-pronto  .number { color: var(--color-pronto);   text-shadow: 0 0 22px rgba(144, 201, 118, 0.3); }
.card-enviado .number { color: var(--color-enviado);  text-shadow: 0 0 22px rgba(107, 174, 173, 0.3); }

.card p {
    font-size: 0.88rem;
    color: var(--cream-muted);
    line-height: 1.4;
    font-weight: 300;
}

/* ===== ORDERS SECTION ===== */
.orders-list-section {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 42px;
    animation: fadeInUp 0.7s ease backwards;
    animation-delay: 0.15s;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-gold);
}

.section-header h2 {
    font-family: 'PP Hatton', serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--cream);
    letter-spacing: 0.03em;
}

.table-container { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 14px 18px;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--gold-text);
    border-bottom: 1px solid var(--border-gold);
    white-space: nowrap;
}

th:first-child { padding-left: 0; }
th:last-child  { padding-right: 0; }

td {
    padding: 18px;
    border-bottom: 1px solid rgba(195, 194, 110, 0.06);
    font-size: 0.96rem;
    color: var(--cream);
    vertical-align: middle;
}

td:first-child { padding-left: 0; }
td:last-child  { padding-right: 0; }

tr:last-child td { border-bottom: none; }

tr { transition: background 0.25s ease; }

tr:hover td { background: rgba(195, 194, 110, 0.03); }

.os-number {
    font-weight: 500;
    color: var(--cream);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    border: 1px solid;
    white-space: nowrap;
}

.badge-aberto   { background: rgba(212, 168, 67,  0.12); color: var(--color-aberto);   border-color: rgba(212, 168, 67,  0.32); }
.badge-producao { background: rgba(126, 184, 217, 0.12); color: var(--color-producao); border-color: rgba(126, 184, 217, 0.32); }
.badge-pronto   { background: rgba(144, 201, 118, 0.12); color: var(--color-pronto);   border-color: rgba(144, 201, 118, 0.32); }

.date-scheduled { color: var(--cream); font-weight: 400; }

.time-cell { color: var(--gold-text); font-weight: 400; }

/* ===== URGENCY CLASSES ===== */
.urgency-critical {
    background: rgba(239, 68, 68, 0.10) !important;
    border-left: 3px solid #ef4444;
}
.urgency-critical .time-cell {
    animation: blinkText 1s infinite;
    color: #ef4444 !important;
    font-weight: 600;
}

.urgency-high {
    background: rgba(239, 68, 68, 0.08) !important;
    border-left: 3px solid #ef4444;
}
.urgency-high .time-cell {
    color: #ef4444 !important;
    font-weight: 600;
}

.urgency-medium {
    background: rgba(212, 168, 67, 0.08) !important;
    border-left: 3px solid var(--color-aberto);
}
.urgency-medium .time-cell {
    color: var(--color-aberto) !important;
    font-weight: 600;
}

.urgency-low {
    border-left: 3px solid rgba(107, 174, 173, 0.35);
}

.text-acombinar {
    animation: blinkText 1.5s infinite;
    color: var(--gold-3) !important;
    font-weight: 500;
}

@keyframes blinkText {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 960px) {
    .container { padding: 28px 20px; }
    .brand-logo-img { height: 80px; }
    .page-title { font-size: 1.3rem; letter-spacing: 0.18em; }
    .orders-list-section { padding: 28px 20px; }
}

/* Mobile landscape / tablet pequeno */
@media (max-width: 768px) {
    .container { padding: 20px 16px; }

    header {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        margin-bottom: 28px;
    }

    .header-logo {
        grid-column: 1;
        grid-row: 1;
    }

    .header-right {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
    }

    .header-center {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: center;
    }

    .brand-logo-img { height: 70px; }

    .page-title { font-size: 1.15rem; letter-spacing: 0.16em; }

    .status-indicator { padding: 10px 14px; gap: 10px; }
    .status-label { font-size: 0.62rem; }
    .status-time { font-size: 0.78rem; }
    .pulse-dot { width: 8px; height: 8px; }

    .divider { margin-bottom: 24px; }

    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .card { padding: 20px 16px; border-radius: 14px; }
    .card-icon { width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; }
    .card-icon svg { width: 20px; height: 20px; }
    .card h3 { font-size: 0.62rem; letter-spacing: 0.12em; margin-bottom: 8px; }
    .number { font-size: 3.8rem; margin-bottom: 10px; }
    .card p { font-size: 0.8rem; }

    .orders-list-section { padding: 20px 16px; border-radius: 16px; }
    .section-header { padding-bottom: 16px; margin-bottom: 0; }
    .section-header h2 { font-size: 1.4rem; }

    /* Tabela → cards empilhados */
    table, thead, tbody, th, td, tr { display: block; }
    thead tr { display: none; }

    #orders-tbody tr {
        margin-bottom: 12px;
        border-radius: 12px;
        border: 1px solid var(--border-gold) !important;
        border-left: 3px solid var(--border-gold) !important;
        padding: 4px 14px;
        background: rgba(24, 26, 16, 0.55);
    }

    #orders-tbody tr.urgency-critical { border-left: 3px solid #ef4444 !important; }
    #orders-tbody tr.urgency-high     { border-left: 3px solid #ef4444 !important; }
    #orders-tbody tr.urgency-medium   { border-left: 3px solid var(--color-aberto) !important; }
    #orders-tbody tr.urgency-low      { border-left: 3px solid rgba(107,174,173,0.4) !important; }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px 2px !important;
        border-bottom: 1px solid rgba(195, 194, 110, 0.06);
        font-size: 0.88rem;
    }

    td:last-child { border-bottom: none; }

    td::before {
        content: attr(data-label);
        font-weight: 400;
        color: var(--gold-text);
        font-size: 0.66rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        text-align: left;
        margin-right: 10px;
        flex-shrink: 0;
    }

    .os-number { flex-direction: column; align-items: flex-end; }
    .os-number div { flex-direction: row-reverse; }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .container { padding: 16px 14px; }

    header {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
        align-items: center;
    }

    .header-logo { grid-column: 1; grid-row: 1; }
    .header-right { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    .header-center { grid-column: 1 / -1; grid-row: 2; }

    .brand-logo-img { height: 58px; }
    .page-title { font-size: 1rem; letter-spacing: 0.14em; }

    .status-indicator { padding: 8px 12px; gap: 8px; border-radius: 20px; }
    .status-label { display: none; }
    .status-time { font-size: 0.72rem; }

    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .card { padding: 18px 14px; }
    .card-icon { width: 40px; height: 40px; margin-bottom: 12px; }
    .card-icon svg { width: 18px; height: 18px; }
    .card h3 { font-size: 0.6rem; }
    .number { font-size: 3.2rem; }
    .card p { font-size: 0.75rem; }
}
