/* =========================
   RESET BÁSICO
========================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f7fa;
    color: #2c3e50;
    line-height: 1.5;
}

/* =========================
   LAYOUT
========================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* =========================
   HEADER / NAV
========================= */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e6ed;
    padding: 16px 24px;
}

.header h1 {
    margin-bottom: 12px;
    font-size: 22px;
    color: #1f2d3d;
}

.nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: #3498db;
    font-weight: 600;
}

.nav a:hover {
    text-decoration: underline;
}

/* =========================
   MESSAGES
========================= */
.message {
    background-color: #eaf4ff;
    border: 1px solid #bcdcff;
    color: #1f4e79;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 8px;
}

/* =========================
   TITLES
========================= */
h2 {
    margin-bottom: 18px;
    font-size: 28px;
    color: #1f2d3d;
}

h3 {
    margin: 28px 0 12px;
    font-size: 20px;
    color: #2c3e50;
}

p {
    margin-bottom: 12px;
}

/* =========================
   TABLE UI
========================= */
.table-ui {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 1px solid #e6ecf2;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.table-ui th {
    background-color: #f1f5f9;
    text-align: left;
    padding: 12px;
    font-size: 13px;
    text-transform: uppercase;
    color: #6b7a8c;
    letter-spacing: 0.03em;
}

.table-ui td {
    padding: 12px;
    border-top: 1px solid #e6ecf2;
    vertical-align: middle;
}

.table-ui tbody tr:nth-child(even) {
    background-color: #fafcfe;
}

.table-ui tbody tr:hover {
    background-color: #f4f8fc;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #8a97a6;
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: #3498db;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #2c80b4;
}

.btn-success {
    background-color: #2ecc71;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #27ae60;
}

.btn-danger {
    background-color: #e74c3c;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* =========================
   BADGES
========================= */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-muted {
    background-color: #ecf0f1;
    color: #4b5b6a;
}

.badge-success {
    background-color: #2ecc71;
    color: #ffffff;
}

.badge-warning {
    background-color: #f39c12;
    color: #ffffff;
}

.badge-danger {
    background-color: #e74c3c;
    color: #ffffff;
}
/* =========================
   FORM UI
========================= */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
}

.form-control {
    width: 100%;
    max-width: 420px;
    padding: 8px 10px;
    border: 1px solid #dcdfe6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #fff;
}

.form-control:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

textarea.form-control {
    min-height: 70px;
    resize: vertical;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-checkbox input {
    transform: scale(1.1);
}

/* =========================
   PAGE / DETAIL LAYOUT
========================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.page-subtitle {
    color: #6b7a8c;
    margin-top: 4px;
}

.card {
    background-color: #ffffff;
    border: 1px solid #e6ecf2;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.detail-grid {
    display: grid;
    gap: 12px;
}

.detail-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: center;
}

.detail-label {
    font-weight: 700;
    color: #4b5b6a;
}

.detail-value {
    color: #1f2d3d;
}

.notes-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e6ecf2;
}

.notes-box h3,
.notes-box h4 {
    margin-bottom: 8px;
}

.notes-content {
    background-color: #f8fafc;
    border: 1px solid #e6ecf2;
    border-radius: 8px;
    padding: 12px;
}

.info-box {
    margin-top: 16px;
    background-color: #f8fafc;
    border: 1px solid #e6ecf2;
    border-radius: 8px;
    padding: 12px;
    color: #334155;
}

/* =========================
   REQUEST ITEM DETAIL
========================= */
.request-item-card h4 {
    margin-bottom: 6px;
}

.request-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.item-product {
    font-size: 17px;
    font-weight: 600;
    color: #1f2d3d;
    margin: 0;
}

.item-top-actions {
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.stat-card {
    background-color: #f8fafc;
    border: 1px solid #e6ecf2;
    border-radius: 8px;
    padding: 12px;
}

.stat-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: #6b7a8c;
    margin-bottom: 6px;
    letter-spacing: 0.03em;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #1f2d3d;
}

.matches-box {
    margin-top: 16px;
}

.item-actions-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e6ecf2;
}

.action-hint {
    color: #6b7a8c;
    font-size: 14px;
}

.action-hint-success {
    color: #1f7a45;
    font-weight: 600;
}

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

/* =========================
   BUTTON VARIANTS
========================= */
.btn-secondary {
    background-color: #eef2f7;
    color: #2c3e50;
}

.btn-secondary:hover {
    background-color: #dde6ef;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 900px) {
    .detail-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .request-item-top {
        flex-direction: column;
    }

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

    .item-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

.request-item-card {
    margin-bottom: 28px; /* mais espaço entre itens */
}

.request-item-card:last-child {
    margin-bottom: 0;
}
/* =========================
   DASHBOARD HERO
========================= */
.dashboard-hero {
    position: relative;
    min-height: 320px;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 28px;
    background-image:
        linear-gradient(135deg, rgba(4, 33, 82, 0.88), rgba(8, 67, 145, 0.72)),
        url("/static/images/dashboard-hero.png");
    background-size: cover;
    background-position: center;
    box-shadow: 0 12px 30px rgba(20, 40, 80, 0.16);
}

.dashboard-hero-overlay {
    width: 100%;
    height: 100%;
}

.dashboard-hero-content {
    padding: 36px;
    max-width: 760px;
    color: #ffffff;
}

.hero-kicker {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.9;
    margin-bottom: 10px;
}

.dashboard-hero h2 {
    color: #ffffff;
    font-size: 40px;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.6;
    margin-bottom: 26px;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.92);
}

.hero-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 14px;
    max-width: 560px;
}

.hero-meta-item {
    background-color: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 14px 16px;
}

.hero-meta-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    color: rgba(255, 255, 255, 0.78);
}

.hero-meta-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

/* =========================
   DASHBOARD CONTENT
========================= */
.dashboard-grid {
    display: grid;
    gap: 20px;
}

.dashboard-card h3 {
    margin-bottom: 14px;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .dashboard-hero {
        min-height: 280px;
    }

    .dashboard-hero-content {
        padding: 24px;
    }

    .dashboard-hero h2 {
        font-size: 30px;
    }

    .hero-meta {
        grid-template-columns: 1fr;
    }
}

/* =========================
   OPEN REQUEST LIST TABLE
========================= */

.open-requests-table {
    width: 100%;
    table-layout: auto;
}

.open-requests-table th.col-id {
    width: 60px;
}

.open-requests-table th.col-pharmacy {
    min-width: 170px;
}

.open-requests-table th.col-products {
    min-width: 280px;
}

.open-requests-table th.col-urgency {
    min-width: 95px;
}

.open-requests-table th.col-status {
    min-width: 160px;
}

.open-requests-table th.col-interaction {
    min-width: 140px;
}

.open-requests-table th.col-items {
    width: 70px;
}

.open-requests-table th.col-created-by {
    min-width: 120px;
}

.open-requests-table th.col-created-at {
    min-width: 120px;
}

.open-requests-table th.col-actions,
.open-requests-table td.col-actions {
    min-width: 200px;
}

/* stack vertical dos botões da coluna ações */

.open-request-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.open-request-actions .btn {
    min-width: 150px;
}

.open-request-actions form {
    margin: 0;
}

/* botão discreto para "Ver detalhes" */

.btn-outline-soft {
    background-color: #f3f6fa;
    color: #4b2ca3;
    border: 1px solid #dbe3ee;
}

.btn-outline-soft:hover {
    background-color: #e9eef5;
}

/* Centrar nomes das colunas dos pedidos pendentes */
.requests-table th {
    text-align: center;
    vertical-align: middle;
}

.requests-table td:nth-child(1),
.requests-table td:nth-child(4),
.requests-table td:nth-child(5),
.requests-table td:nth-child(6),
.requests-table td:nth-child(7),
.requests-table td:nth-child(8),
.requests-table td:nth-child(9) {
    text-align: center;
}

/* =========================
   AVAILABILITY TABLE
========================= */

.availability-table td:nth-child(1) {
    width: 30%;
    vertical-align: top;
}
.availability-table td {
    vertical-align: middle;
}

.availability-table td:nth-child(6) {
    vertical-align: top;
}
.availability-table .badge-muted {
    background-color: #eef2f7;
    color: #526273;
    font-weight: 600;
}
.availability-table td:nth-child(5),
.availability-table td:nth-child(7),
.availability-table td:nth-child(8),
.availability-table td:nth-child(9),
.availability-table td:nth-child(10) {
    text-align: center;
    white-space: nowrap;
}

.availability-table td:nth-child(6) {
    font-size: 13px;
    color: #4b5b6a;
}

/* =========================
   AVAILABILITY PRODUCT CELL
========================= */

.availability-product-cell {
    min-width: 280px;
    max-width: 360px;
}

.availability-product-main {
    font-size: 15px;
    font-weight: 700;
    color: #1f2d3d;
    margin-bottom: 4px;
    line-height: 1.3;
}

.availability-product-name {
    font-size: 15px;
    font-weight: 600;
    color: #23415f;
    line-height: 1.45;
    margin-bottom: 4px;
}

.availability-product-meta {
    font-size: 13px;
    color: #6b7a8c;
    line-height: 1.45;
}

/* =========================
   AVAILABILITY BATCHES
========================= */

.availability-batches-cell {
    min-width: 150px;
    vertical-align: middle !important;
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
    height: 100%;
}

.availability-batches-cell {
    vertical-align: middle;
}

.batch-list:has(.batch-pill:only-child) {
    align-items: center;
}

.availability-batches-cell .batch-list {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.availability-batches-cell .batch-list:has(.batch-pill:only-child) {
    align-items: center;
}

.availability-table td.availability-batches-cell {
    vertical-align: middle !important;
}

.batch-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background-color: #f3f6fa;
    border: 1px solid #dbe3ee;
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.batch-pill-primary {
    background-color: #eaf4ff;
    border-color: #bcdcff;
    color: #1f4e79;
}

.batch-expiry {
    font-weight: 700;
}

.batch-separator {
    color: #8a97a6;
}

.batch-qty {
    font-weight: 700;
}

.text-muted {
    color: #8a97a6;
}

/* =========================
   AVAILABILITY TABLE HEADERS
========================= */

.availability-table th {
    text-align: center;
    vertical-align: middle;
}

.availability-table th:first-child {
    text-align: left;
}

/* Conteúdo: produto à esquerda, resto mais organizado */
.availability-table td:nth-child(2),
.availability-table td:nth-child(3),
.availability-table td:nth-child(5),
.availability-table td:nth-child(6),
.availability-table td:nth-child(7),
.availability-table td:nth-child(8),
.availability-table td:nth-child(9),
.availability-table td:nth-child(10) {
    text-align: center;
}

.detail-value .batch-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.form-control,
select.form-control,
input.form-control,
textarea.form-control {
    max-width: 520px;
}

#product-results {
    background-color: #ffffff;
    border: 1px solid #e6ecf2;
    border-radius: 8px;
    overflow: hidden;
}

#product-results > div:hover {
    background-color: #f4f8fc;
}

#batch-table .form-control {
    max-width: 100%;
}

#batch-table td {
    vertical-align: middle;
}

#batch-table .btn {
    min-width: 110px;
}

.form-group-product {
    width: 100%;
    max-width: 980px;
}

.form-group-product .product-search-input {
    width: 100%;
    max-width: 980px !important;
    font-weight: 600;
}

.form-group-product .form-control {
    max-width: 980px !important;
}

.product-search-input {
    font-weight: 600;
}

/* =========================
   REQUEST LIST (MINE)
========================= */

.filter-card {
    margin-bottom: 20px;
}

.filter-grid {
    display: grid;
    gap: 16px;
    align-items: end;
}

.filter-grid-requests {
    grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr);
}

.filter-grid-requests .form-group {
    margin-bottom: 0;
}

.filter-grid-requests .form-control,
.filter-grid-requests select.form-control,
.filter-grid-requests input.form-control {
    max-width: 100%;
}

.filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.mine-requests-table th.col-id {
    width: 70px;
}

.mine-requests-table th.col-products {
    min-width: 420px;
}

.mine-requests-table th.col-urgency {
    min-width: 110px;
}

.mine-requests-table th.col-status {
    min-width: 150px;
}

.mine-requests-table th.col-items {
    width: 70px;
}

.mine-requests-table th.col-created-by {
    min-width: 130px;
}

.mine-requests-table th.col-created-at {
    min-width: 130px;
}

.mine-requests-table th.col-actions,
.mine-requests-table td.col-actions {
    width: 170px;
}

.request-products-cell {
    line-height: 1.55;
    white-space: normal;
}

.request-list-actions {
    display: flex;
    justify-content: center;
    align-items: center;
}

.request-list-actions .btn {
    min-width: 135px;
}

@media (max-width: 900px) {
    .filter-grid-requests {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        grid-column: auto;
    }
}

/* =========================
   MY AVAILABILITY LIST
========================= */

.filter-grid-my-availabilities {
    grid-template-columns: minmax(280px, 2fr) minmax(180px, 1fr) minmax(180px, 1fr);
}

.filter-grid-my-availabilities .form-group {
    margin-bottom: 0;
}

.filter-grid-my-availabilities .form-control,
.filter-grid-my-availabilities select.form-control,
.filter-grid-my-availabilities input.form-control {
    max-width: 100%;
}

.my-availability-table {
    width: 100%;
    table-layout: auto;
}

.my-availability-table th,
.my-availability-table td {
    vertical-align: middle;
}

.my-availability-table th {
    text-align: center;
    vertical-align: middle;
}

.my-availability-table th.col-product {
    min-width: 290px;
    text-align: left;
}

.my-availability-table th.col-origin {
    min-width: 110px;
}

.my-availability-table th.col-type {
    min-width: 140px;
}

.my-availability-table th.col-quantity {
    min-width: 90px;
}

.my-availability-table th.col-batches {
    min-width: 120px;
}

.my-availability-table th.col-status {
    min-width: 100px;
}

.my-availability-table th.col-expires {
    min-width: 130px;
}

.my-availability-table th.col-created {
    min-width: 130px;
}

.my-availability-table th.col-actions,
.my-availability-table td.col-actions {
    min-width: 140px;
}

.my-availability-product-cell {
    min-width: 290px;
    max-width: 380px;
    width: auto;
}

.my-availability-table .availability-product-main,
.my-availability-table .availability-product-name,
.my-availability-table .availability-product-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.my-availability-table td:nth-child(2),
.my-availability-table td:nth-child(3),
.my-availability-table td:nth-child(4),
.my-availability-table td:nth-child(5),
.my-availability-table td:nth-child(6),
.my-availability-table td:nth-child(7),
.my-availability-table td:nth-child(8),
.my-availability-table td:nth-child(9) {
    text-align: center;
    vertical-align: middle;
}

.my-availability-table td:nth-child(7),
.my-availability-table td:nth-child(8) {
    white-space: nowrap;
}

.my-availability-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.my-availability-actions form {
    margin: 0;
}

.my-availability-actions .btn {
    width: 100%;
    min-width: 120px;
    text-align: center;
}

@media (max-width: 1100px) {
    .my-availability-table th.col-product {
        min-width: 250px;
    }

    .my-availability-product-cell {
        min-width: 250px;
        max-width: 320px;
    }
}

@media (max-width: 900px) {
    .filter-grid-my-availabilities {
        grid-template-columns: 1fr;
    }
}

/* =========================
   APP SHELL / GLOBAL DEPTH
========================= */

body.app-shell {
    background:
        radial-gradient(circle at 12% 10%, rgba(32, 110, 218, 0.10), transparent 32%),
        radial-gradient(circle at 88% 14%, rgba(12, 67, 145, 0.08), transparent 28%),
        radial-gradient(circle at 82% 88%, rgba(52, 152, 219, 0.07), transparent 30%),
        linear-gradient(180deg, #f4f7fb 0%, #edf3f9 100%);
    background-attachment: fixed;
}

body.auth-shell {
    background:
        radial-gradient(circle at top left, rgba(32, 110, 218, 0.08), transparent 30%),
        linear-gradient(180deg, #f5f7fa 0%, #eef3f8 100%);
    min-height: 100vh;
}

/* =========================
   HEADER / NAV REWORK
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(224, 230, 237, 0.88);
    box-shadow: 0 12px 30px rgba(15, 35, 75, 0.07);
    padding: 14px 24px;
}

.header-inner {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
}

.brand-block {
    flex-shrink: 0;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-link:hover {
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #3a9be4 0%, #1e6eda 55%, #11478f 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 22px rgba(30, 110, 218, 0.24);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #17324e;
    line-height: 1;
}

.brand-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #6b7a8c;
    line-height: 1.2;
}

.nav-main {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
    min-width: 0;
}

.nav-main a {
    white-space: nowrap;
    font-size: 15px;
}

.nav-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
}

.nav a {
    position: relative;
    text-decoration: none;
    color: #2783d6;
    font-weight: 700;
    padding: 8px 0;
    transition: color 0.2s ease, transform 0.15s ease;
}

.nav a:hover {
    text-decoration: none;
    color: #174f8f;
    transform: translateY(-1px);
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #3498db, #174f8f);
    transition: width 0.22s ease;
}

.nav a:hover::after {
    width: 100%;
}

.logout-form {
    margin: 0;
}

.brand-login-link {
    font-weight: 700;
}

/* =========================
   RESPONSIVE HEADER GRID FIX
========================= */

@media (max-width: 1100px) {

    .header-inner {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .brand-block {
        justify-content: flex-start;
    }

    .nav-main {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .nav-actions {
        justify-content: flex-start;
    }

}

/* =========================
   CONTAINER / SURFACE
========================= */

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 30px 24px 40px;
}

/* =========================
   BUTTON POLISH
========================= */

.btn {
    display: inline-block;
    padding: 9px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #3a9be4 0%, #1e6eda 55%, #11478f 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(30, 110, 218, 0.22);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #46a5ec 0%, #2574df 55%, #144a95 100%);
    box-shadow: 0 12px 24px rgba(30, 110, 218, 0.28);
}

.btn-secondary {
    background-color: #eef3f8;
    color: #243b53;
    border: 1px solid #dde6ef;
}

.btn-secondary:hover {
    background-color: #e6edf5;
    box-shadow: 0 8px 18px rgba(30, 60, 100, 0.08);
}

.btn-danger {
    background: linear-gradient(135deg, #ef5b49 0%, #e74c3c 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(231, 76, 60, 0.18);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f16a59 0%, #df4939 100%);
    box-shadow: 0 10px 22px rgba(231, 76, 60, 0.24);
}

.btn-outline-soft {
    background-color: #f7f9fc;
    color: #4b2ca3;
    border: 1px solid #dbe3ee;
}

.btn-outline-soft:hover {
    background-color: #eef3f9;
    box-shadow: 0 8px 18px rgba(50, 70, 110, 0.08);
}

/* =========================
   CARD DEPTH
========================= */

.card {
    background-color: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(230, 236, 242, 0.95);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 14px 36px rgba(18, 40, 72, 0.06);
}

/* =========================
   TABLE SURFACE
========================= */

.table-ui {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: rgba(255, 255, 255, 0.92);
    border: 1px solid #e6ecf2;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(16, 38, 70, 0.05);
}

.table-ui th {
    background: linear-gradient(180deg, #f7faff 0%, #eef3f8 100%);
}

/* =========================
   MESSAGES
========================= */

.message {
    background: linear-gradient(180deg, #eef7ff 0%, #e8f3ff 100%);
    border: 1px solid #bfdcff;
    color: #1f4e79;
    padding: 13px 15px;
    margin-bottom: 16px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(31, 78, 121, 0.06);
}

/* =========================
   DASHBOARD POLISH
========================= */

.dashboard-hero {
    box-shadow:
        0 24px 50px rgba(14, 44, 96, 0.20),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.dashboard-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 25%, rgba(255, 255, 255, 0.12), transparent 26%),
        radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.08), transparent 24%),
        radial-gradient(circle at 80% 75%, rgba(255, 255, 255, 0.10), transparent 22%);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
}

.hero-meta-item {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* =========================
   LOGIN BASE PREP
========================= */

body.auth-shell .container {
    max-width: 520px;
    padding-top: 56px;
}

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

@media (max-width: 768px) {
    .header {
        padding: 16px 18px 14px;
    }

    .header h1 {
        font-size: 21px;
        margin-bottom: 12px;
    }

    .container {
        padding: 22px 16px 34px;
    }
}

/* =========================
   PAGE HERO (REUSABLE)
========================= */

.page-hero {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    margin-bottom: 24px;
    background:
        linear-gradient(135deg, rgba(8, 48, 107, 0.94), rgba(18, 87, 170, 0.84)),
        url("/static/images/dashboard-hero.png");
    background-size: cover;
    background-position: center;
    box-shadow: 0 22px 46px rgba(14, 44, 96, 0.16);
}

.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 16% 24%, rgba(255, 255, 255, 0.10), transparent 24%),
        radial-gradient(circle at 74% 34%, rgba(255, 255, 255, 0.08), transparent 22%),
        radial-gradient(circle at 80% 78%, rgba(255, 255, 255, 0.08), transparent 18%);
    pointer-events: none;
}

.page-hero-content {
    position: relative;
    z-index: 1;
    padding: 28px 32px;
    color: #ffffff;
}

.page-hero-kicker {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.82);
}

.page-hero-title {
    margin: 0 0 10px;
    font-size: 38px;
    line-height: 1.08;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.page-hero-subtitle {
    margin: 0;
    max-width: 760px;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.92);
}

.page-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.page-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.page-hero-pill-label {
    color: rgba(255, 255, 255, 0.74);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}

.page-hero + .page-header {
    margin-top: -2px;
}

@media (max-width: 768px) {
    .page-hero-content {
        padding: 24px 22px;
    }

    .page-hero-title {
        font-size: 30px;
    }

    .page-hero-subtitle {
        font-size: 15px;
    }

    .page-hero-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   NETWORK AVAILABILITY LIST
========================= */

.filter-grid-network-availability {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.filter-grid-network-availability .form-group {
    margin-bottom: 0;
}

.filter-grid-network-availability .form-control,
.filter-grid-network-availability select.form-control,
.filter-grid-network-availability input.form-control {
    max-width: 100%;
}

.status-pill-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.section-card-header {
    margin-bottom: 14px;
}

.section-card-header h3 {
    margin: 0 0 6px;
}

.section-card-subtitle {
    margin: 0;
    color: #6b7a8c;
    font-size: 14px;
}

.network-availability-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    min-width: 140px;
}

.network-availability-actions form {
    margin: 0;
}

.network-availability-actions .btn {
    width: 100%;
    text-align: center;
}

@media (max-width: 1000px) {
    .filter-grid-network-availability {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .filter-grid-network-availability {
        grid-template-columns: 1fr;
    }
}

/* =========================
   NETWORK FILTER COMPACT
========================= */

.network-filter-card {
    padding: 16px 20px 18px;
}

.compact-filter-grid {
    gap: 12px;
}

.compact-filter-grid .form-group {
    margin-bottom: 0;
}

.compact-filter-grid label {
    margin-bottom: 5px;
    font-size: 14px;
}

.compact-filter-grid .form-control,
.compact-filter-grid select.form-control,
.compact-filter-grid input.form-control {
    max-width: 100%;
}

.compact-filter-actions {
    margin-top: 2px;
}

.compact-status-pill-row {
    margin-top: 14px;
}

/* =========================
   COLLAPSIBLE SECTIONS
========================= */

.collapsible-section {
    padding: 0;
    overflow: hidden;
}

.collapsible-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary h3 {
    margin: 0 0 4px;
}

.collapsible-meta {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef3f8;
    color: #31475f;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.collapsible-content {
    padding: 0 20px 20px;
}

.collapsible-section[open] .collapsible-summary {
    border-bottom: 1px solid #e8eef5;
}

@media (max-width: 1000px) {
    .filter-grid-network-availability {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .filter-grid-network-availability {
        grid-template-columns: 1fr;
    }

    .collapsible-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   OPEN REQUEST FILTERS
========================= */

.filter-grid-open-requests {
    grid-template-columns: repeat(5, minmax(170px, 1fr));
}

.filter-grid-open-requests .form-group {
    margin-bottom: 0;
}

.filter-grid-open-requests .form-control,
.filter-grid-open-requests select.form-control,
.filter-grid-open-requests input.form-control {
    max-width: 100%;
}

@media (max-width: 1200px) {
    .filter-grid-open-requests {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 850px) {
    .filter-grid-open-requests {
        grid-template-columns: 1fr;
    }
}

/* =========================
   PENDING PAGE ACTION STACK
========================= */

.open-request-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    min-width: 140px;
}

.open-request-actions form {
    margin: 0;
}

.open-request-actions .btn {
    width: 100%;
    text-align: center;
}

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

.empty-state {
    padding: 18px 20px;
    background: #f6f9fc;
    border-radius: 10px;
    color: #5b6b7c;
}

/* =========================
   NOTIFICATIONS
========================= */

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.notification-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(230, 236, 242, 0.95);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 12px 28px rgba(16, 38, 70, 0.06);
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.notification-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.notification-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef3f8;
    border: 1px solid #dbe3ee;
    color: #2c4a68;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.notification-date {
    font-size: 13px;
    color: #7b8a9a;
    white-space: nowrap;
}

.notification-body {
    font-size: 15px;
    line-height: 1.65;
    color: #33495f;
}

.notification-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

@media (max-width: 700px) {
    .notification-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .notification-date {
        white-space: normal;
    }

    .notification-actions {
        justify-content: flex-start;
    }
}
/* =========================
   MATCHING PANEL
========================= */

.matches-panel {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #e6ecf2;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 12px;
}

.matches-panel-header {
    margin-bottom: 14px;
}

.matches-panel-header h4 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #2c3e50;
}

.matches-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.matches-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef3f8;
    border: 1px solid #dbe3ee;
    color: #31475f;
    font-size: 14px;
    font-weight: 600;
}

.matches-section {
    margin-top: 18px;
}

.matches-section:first-of-type {
    margin-top: 0;
}

.matches-section-title {
    margin: 0 0 10px;
    font-size: 17px;
    color: #33495f;
}

.matches-table {
    margin-bottom: 0;
}

.matches-product-cell {
    min-width: 280px;
}

.matches-product-name {
    font-weight: 700;
    color: #243b53;
    margin-bottom: 4px;
    line-height: 1.35;
}

.matches-product-meta {
    font-size: 13px;
    color: #6b7a8c;
    line-height: 1.45;
}

@media (max-width: 900px) {
    .matches-summary-pills {
        flex-direction: column;
        align-items: flex-start;
    }
}