@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --background: #f5f7fa;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --border: #e3e8ef;

    --text: #172033;
    --text-soft: #647084;

    --primary: #193a67;
    --primary-hover: #102d52;

    --accent: #d6e4f5;

    --success: #177245;
    --success-soft: #ecfdf3;

    --warning: #9a6700;
    --warning-soft: #fff8e6;

    --danger: #b42318;
    --danger-soft: #fef3f2;

    --radius: 14px;

    --shadow:
        0 5px 18px rgba(25, 42, 67, 0.035);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--text);
}

body {
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================
   ESTRUTURA
   ========================================= */

.leiloeiro-shell {
    display: grid;
    grid-template-columns: 276px minmax(0, 1fr);
    min-height: 100vh;
}

/* =========================================
   SIDEBAR
   ========================================= */

.leiloeiro-sidebar {
    position: sticky;
    top: 0;

    display: flex;
    flex-direction: column;

    height: 100vh;

    padding: 28px 20px 20px;

    overflow-y: auto;

    color: #ffffff;
    background: #132b4a;
}

.leiloeiro-brand {
    display: flex;

    gap: 13px;

    align-items: center;

    padding: 0 8px;

    color: #ffffff;

    text-decoration: none;
}

.leiloeiro-brand-mark {
    display: grid;

    width: 42px;
    height: 42px;

    place-items: center;

    flex: 0 0 42px;

    border-radius: 12px;

    background: rgba(255, 255, 255, 0.10);

    font-size: 12px;
    font-weight: 700;

    letter-spacing: .08em;
}

.leiloeiro-brand-text strong,
.leiloeiro-brand-text small {
    display: block;
}

.leiloeiro-brand-text strong {
    font-size: 14px;
}

.leiloeiro-brand-text small {
    margin-top: 3px;

    color: rgba(255, 255, 255, .52);

    font-size: 10px;
}

.leiloeiro-nav {
    display: grid;

    gap: 5px;

    margin-top: 42px;
}

.nav-section {
    margin: 23px 12px 8px;

    color: rgba(255, 255, 255, .36);

    font-size: 9px;
    font-weight: 700;

    letter-spacing: .15em;

    text-transform: uppercase;
}

.nav-item {
    display: flex;

    min-height: 43px;

    gap: 11px;

    align-items: center;

    padding: 0 13px;

    border-radius: 10px;

    color: rgba(255, 255, 255, .67);

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition:
        color 150ms ease,
        background 150ms ease;
}

.nav-item:hover,
.nav-item.active {
    color: #ffffff;

    background: rgba(255, 255, 255, .09);
}

.nav-item.disabled {
    opacity: .42;

    cursor: default;
}

.nav-icon {
    display: grid;

    width: 22px;

    place-items: center;

    flex: 0 0 22px;

    font-size: 13px;
}

.sidebar-spacer {
    flex: 1;
}

.sidebar-footer {
    margin-top: 28px;

    padding-top: 18px;

    border-top: 1px solid rgba(255, 255, 255, .10);
}

.sidebar-footer-label {
    display: block;

    margin-bottom: 4px;

    color: rgba(255, 255, 255, .42);

    font-size: 9px;

    text-transform: uppercase;

    letter-spacing: .1em;
}

.sidebar-footer strong {
    display: block;

    overflow: hidden;

    color: #ffffff;

    font-size: 11px;

    text-overflow: ellipsis;

    white-space: nowrap;
}

/* =========================================
   CONTEÚDO
   ========================================= */

.leiloeiro-main {
    min-width: 0;

    padding: 46px;
}

.page-header {
    display: flex;

    gap: 30px;

    align-items: flex-start;

    justify-content: space-between;

    margin-bottom: 38px;
}

.page-eyebrow {
    margin: 0 0 12px;

    color: #46709f;

    font-size: 12px;
    font-weight: 700;

    letter-spacing: .14em;

    text-transform: uppercase;
}

.page-header h1 {
    margin: 0;

    color: var(--text);

    font-size: 32px;

    letter-spacing: -.035em;
}

.page-description {
    max-width: 700px;

    margin: 10px 0 0;

    color: var(--text-soft);

    font-size: 14px;

    line-height: 1.6;
}

.page-actions {
    display: flex;

    gap: 10px;

    flex-wrap: wrap;
}

/* =========================================
   BOTÕES
   ========================================= */

.btn {
    display: inline-flex;

    min-height: 42px;

    align-items: center;

    justify-content: center;

    gap: 8px;

    padding: 0 17px;

    border-radius: 11px;

    text-decoration: none;

    font-size: 12px;
    font-weight: 700;

    cursor: pointer;
}

.btn-primary {
    border: 1px solid var(--primary);

    color: #ffffff;

    background: var(--primary);

    box-shadow: 0 10px 22px rgba(25, 58, 103, .16);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    border: 1px solid #d5dde7;

    color: #314259;

    background: #ffffff;
}

/* =========================================
   MÉTRICAS
   ========================================= */

.metrics-grid {
    display: grid;

    gap: 18px;

    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    display: grid;

    gap: 8px;

    padding: 23px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.metric-label {
    color: #687589;

    font-size: 12px;
    font-weight: 600;
}

.metric-value {
    font-size: 31px;
    font-weight: 700;

    letter-spacing: -.04em;
}

.metric-help {
    color: #9aa3b1;

    font-size: 11px;
}

/* =========================================
   GRID PRINCIPAL
   ========================================= */

.dashboard-grid {
    display: grid;

    gap: 18px;

    margin-top: 18px;

    grid-template-columns:
        minmax(0, 1.8fr)
        minmax(300px, .8fr);
}

.card {
    padding: 25px;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    background: var(--surface);

    box-shadow: var(--shadow);
}

.card-header {
    display: flex;

    gap: 20px;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 22px;
}

.card-eyebrow {
    margin: 0 0 8px;

    color: #46709f;

    font-size: 10px;
    font-weight: 700;

    letter-spacing: .14em;

    text-transform: uppercase;
}

.card-header h2 {
    margin: 0;

    font-size: 17px;

    letter-spacing: -.02em;
}

/* =========================================
   EMPTY
   ========================================= */

.empty-state {
    display: grid;

    min-height: 300px;

    align-content: center;

    justify-items: center;

    padding: 45px 25px;

    text-align: center;
}

.empty-icon {
    display: grid;

    width: 50px;
    height: 50px;

    margin-bottom: 18px;

    place-items: center;

    border: 1px solid #d7e2ee;

    border-radius: 14px;

    color: #416b99;

    background: #eef4fa;

    font-size: 20px;
}

.empty-state h3 {
    margin: 0;

    font-size: 16px;
}

.empty-state p {
    max-width: 450px;

    margin: 10px 0 0;

    color: var(--text-soft);

    font-size: 13px;

    line-height: 1.65;
}

/* =========================================
   LIVROS
   ========================================= */

.books-list {
    display: grid;

    gap: 11px;
}

.book-item {
    display: flex;

    gap: 15px;

    align-items: center;

    padding: 15px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: #ffffff;
}

.book-icon {
    display: grid;

    width: 38px;
    height: 38px;

    place-items: center;

    flex: 0 0 38px;

    border-radius: 10px;

    color: #416b99;

    background: #eef4fa;

    font-size: 13px;
}

.book-data {
    min-width: 0;
}

.book-data strong,
.book-data small {
    display: block;
}

.book-data strong {
    font-size: 12px;
}

.book-data small {
    margin-top: 5px;

    color: var(--text-soft);

    font-size: 10px;
}

/* =========================================
   FLUXO
   ========================================= */

.flow-list {
    display: grid;

    gap: 10px;
}

.flow-step {
    display: grid;

    grid-template-columns: 32px minmax(0, 1fr);

    gap: 12px;

    align-items: start;

    padding: 13px 0;

    border-bottom: 1px solid #edf0f4;
}

.flow-step:last-child {
    border-bottom: 0;
}

.flow-number {
    display: grid;

    width: 30px;
    height: 30px;

    place-items: center;

    border-radius: 9px;

    color: #315f91;

    background: #eef4fa;

    font-size: 10px;
    font-weight: 700;
}

.flow-step strong {
    display: block;

    margin-top: 1px;

    font-size: 12px;
}

.flow-step p {
    margin: 5px 0 0;

    color: var(--text-soft);

    font-size: 11px;

    line-height: 1.55;
}

/* =========================================
   ALERT
   ========================================= */

.alert {
    margin-bottom: 20px;

    padding: 13px 15px;

    border-radius: 10px;

    font-size: 13px;
}

.alert-success {
    border: 1px solid #b7e7cd;

    color: var(--success);

    background: var(--success-soft);
}

.alert-danger {
    border: 1px solid #fecdca;

    color: var(--danger);

    background: var(--danger-soft);
}

/* =========================================
   RESPONSIVO
   ========================================= */

@media (max-width: 1150px) {

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 830px) {

    .leiloeiro-shell {
        display: block;
    }

    .leiloeiro-sidebar {
        position: relative;

        width: 100%;
        height: auto;
    }

    .leiloeiro-nav {
        margin-top: 22px;
    }

    .sidebar-spacer {
        display: none;
    }

    .leiloeiro-main {
        padding: 26px 18px;
    }

}

@media (max-width: 560px) {

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        display: block;
    }

    .page-actions {
        margin-top: 18px;
    }

    .leiloeiro-main {
        padding: 22px 14px;
    }

}

/* =========================================
   CADASTROS
   ========================================= */

.content-card {
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-section {
    margin-top: 28px;
    padding-top: 25px;
    border-top: 1px solid var(--border);
}

.form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.form-section-title {
    margin: 0 0 20px;
    font-size: 15px;
    font-weight: 700;
}

.form-field {
    display: grid;
    gap: 7px;
}

.form-field label {
    color: #344054;
    font-size: 12px;
    font-weight: 600;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 11px 13px;
    outline: none;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    color: var(--text);
    background: #fff;
    font-size: 13px;
}

.form-field input,
.form-field select {
    min-height: 44px;
}

.form-field textarea {
    min-height: 100px;
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: #537cac;
    box-shadow: 0 0 0 3px rgba(77,119,167,.11);
}

.form-full {
    grid-column: 1 / -1;
}

.checkbox-row {
    display: flex;
    gap: 9px;
    align-items: center;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.data-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 13px 15px;
    border-bottom: 1px solid #edf0f4;
    text-align: left;
    font-size: 12px;
    vertical-align: middle;
}

.data-table th {
    color: #697588;
    background: #f8fafc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.table-link {
    color: #234f7d;
    font-weight: 700;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

.badge {
    display: inline-flex;
    padding: 5px 9px;
    align-items: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
}

.badge-success {
    color: #177245;
    background: #ecfdf3;
}

.badge-muted {
    color: #677386;
    background: #eef1f5;
}

.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-row input {
    width: min(100%, 420px);
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    outline: none;
}

.errors-box {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid #fecdca;
    border-radius: 10px;
    color: #b42318;
    background: #fef3f2;
    font-size: 12px;
}

.errors-box ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

@media (max-width: 760px) {
    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: auto;
    }

    .search-row {
        display: grid;
    }

    .search-row input {
        width: 100%;
    }
}
