/* =========================
   Base / Fonts
========================= */
* {
    box-sizing: border-box;
}

@font-face {
    font-family: 'Gotham';
    src: url('../fonts/frontend/Gotham-Book.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('../fonts/frontend/Gotham-Medium.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

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

@font-face {
    font-family: 'FuturaBook';
    src: url('../fonts/frontend/Futura%20Book%20font.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #325f8f;
    --primary-dark: #264b73;
    --blue: #2563eb;
    --green: #16a34a;
    --red: #dc2626;
    --orange: #f59e0b;
    --sky: #0ea5e9;
    --dark: #111827;
    --body-bg: #f4f7fb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --border: #e5e7eb;
    --shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

body {
    margin: 0;
    font-family: 'Gotham', Arial, Helvetica, sans-serif;
    background: var(--body-bg);
    color: var(--text);
}

.text-success { color: var(--green); }
.text-danger { color: var(--red); }
.text-right { text-align: right; }

/* =========================
   App Layout / Sidebar
========================= */
.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--body-bg);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    padding: 28px 22px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 36px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.sidebar-brand h2 {
    margin: 0;
    font-size: 18px;
}

.sidebar-brand p {
    margin: 4px 0 0;
    font-size: 12px;
    color: #ffffff;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 16px;
    color: #eef6ff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: .2s ease;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    opacity: .95;
}

.nav-link span {
    line-height: 1;
}

.nav-link:hover,
.nav-link.active {
    background: #ffffff;
    color: #000000;
}

.sidebar-logout {
    margin-top: auto;
}

.sidebar-logout button {
    width: 100%;
    border: 0;
    background: #ffffff;
    color: #000000;
    padding: 13px 15px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
}

.sidebar-logout button:hover {
    background: var(--red);
    color: #ffffff;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 34px;
}

.mobile-menu-btn {
    display: none;
    width: 100%;
    border: 0;
    background: var(--primary);
    color: #ffffff;
    padding: 16px 22px;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

/* =========================
   Buttons
========================= */
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info,
.btn-dark,
.btn-filter,
.btn-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: .2s ease;
}

.btn-primary { background: var(--blue); color: #ffffff; box-shadow: 0 8px 18px rgba(37, 99, 235, .18); }
.btn-primary:hover { background: #1d4ed8; }

.btn-secondary,
.btn-reset { background: #f8fafc; color: #334155; border-color: #cbd5e1; }
.btn-secondary:hover,
.btn-reset:hover { background: #f1f5f9; }

.btn-success { background: var(--green); color: #ffffff; box-shadow: 0 8px 18px rgba(22, 163, 74, .18); }
.btn-success:hover { background: #15803d; }

.btn-danger { background: var(--red); color: #ffffff; box-shadow: 0 8px 18px rgba(220, 38, 38, .18); }
.btn-danger:hover { background: #b91c1c; }

.btn-warning { background: var(--orange); color: #ffffff; box-shadow: 0 8px 18px rgba(245, 158, 11, .18); }
.btn-warning:hover { background: #d97706; }

.btn-info { background: var(--sky); color: #ffffff; box-shadow: 0 8px 18px rgba(14, 165, 233, .18); }
.btn-info:hover { background: #0284c7; }

.btn-dark,
.btn-filter { background: var(--dark); color: #ffffff; }
.btn-dark:hover,
.btn-filter:hover { background: #000000; }

.btn-filter,
.btn-reset {
    min-height: 42px;
    font-weight: 800;
}

/* =========================
   Page Header
========================= */
.page-header {
    background: var(--card-bg);
    padding: 24px 28px;
    box-shadow: var(--shadow);
    margin-bottom: 26px;
}

.page-header-inner,
.page-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.page-header-between {
    justify-content: space-between;
}

.page-header-icon {
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-header-icon svg {
    width: 28px;
    height: 28px;
}

.page-header h1 {
    margin: 0;
    font-size: 28px;
    color: #111827;
}

.page-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

/* =========================
   Badges
========================= */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-transform: capitalize;
    letter-spacing: .02em;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    flex-shrink: 0;
}

.status-pending,
.status-suspended {
    background: #fff7ed;
    color: #d97706;
    border-color: #fdba74;
}

.status-posted,
.status-success,
.status-active {
    background: #ecfdf5;
    color: #15803d;
    border-color: #86efac;
}

/*
.status-voided {
    background: #f3f4f6;
    color: #4b5563;
    border-color: #d1d5db;
}
*/

.status-failed,
.status-danger,
.status-banned,
.status-voided {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

.status-inactive {
    background: #f8fafc;
    color: #64748b;
    border-color: #cbd5e1;
}

/* =========================
   Tables / Filters
========================= */
.table-card {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.table-header h2 {
    margin: 0;
    font-size: 20px;
}

.table-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.filter-bar {
    padding: 18px 28px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.filter-control {
    min-width: 180px;
    min-height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 12px;
    background: #ffffff;
    color: #111827;
}

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

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

.table-card th {
    background: #f8fafc;
    color: var(--muted);
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    padding: 14px 24px;
}

.table-card th.text-right {
    text-align: right;
}

.table-card th.text-left {
    text-align: left;
}

.table-card td {
    padding: 18px 24px;
    border-top: 1px solid #f1f5f9;
    color: #334155;
    font-size: 14px;
}

.table-link {
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.table-link:hover {
    color: #1e40af;
}

.pagination-wrap {
    padding: 18px 28px;
    border-top: 1px solid var(--border);
}

/* =========================
   Responsive
========================= */
@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        display: none;
        position: relative;
        width: 100%;
        inset: auto;
    }

    .sidebar.is-open {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .table-actions,
    .filter-bar {
        width: 100%;
        flex-direction: column;
    }

    .table-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-control,
    .btn-filter,
    .btn-reset,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger,
    .btn-warning,
    .btn-info,
    .btn-dark {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 18px;
    }

    .page-header {
        padding: 20px;
    }

    .page-header-between,
    .page-header-left {
        align-items: flex-start;
    }

    .page-header-icon {
        width: 48px;
        height: 48px;
    }

    .page-header-icon svg {
        width: 24px;
        height: 24px;
    }

    .page-header h1 {
        font-size: 22px;
    }
}

/* Error section */
.alert {
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}
