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

:root {
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #eff6ff;
    --bg: #f5f8fc;
    --white: #fff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5eaf2;
    --green: #16a34a;
    --red: #dc2626;
    --shadow: 0 8px 28px rgba(15,23,42,.06);
    --radius: 16px;
    --sidebar-width: 248px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--blue);
}

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

.container {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

/* APP LAYOUT */

.app-layout {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: #fff;
    border-right: 1px solid var(--border);
    z-index: 50;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
    overflow: hidden;
}

.sidebar-brand {
    height: 68px;
    min-height: 68px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand > a {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.7px;
    color: #0f172a;
}

.sidebar-brand > a span {
    color: var(--blue);
    margin-left: 3px;
}

.sidebar-close {
    display: none;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 25px;
    cursor: pointer;
}

.sidebar-nav {
    padding: 12px 10px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #dbe3ef;
    border-radius: 10px;
}

.nav-section {
    display: grid;
    gap: 3px;
    margin-bottom: 12px;
}

.nav-heading {
    padding: 12px 10px 7px;
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .7px;
}

.nav-link {
    min-height: 38px;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 9px;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    transition: background .18s, color .18s;
}

.nav-link > span {
    width: 17px;
    flex: 0 0 17px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--blue);
}

.nav-link:hover > span {
    color: var(--blue);
}

.nav-link.active {
    background: #eff6ff;
    color: var(--blue);
    font-weight: 700;
}

.nav-link.active > span {
    color: var(--blue);
}

/* MAIN AREA */

.main-area {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 68px;
    min-height: 68px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 18px;
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 13px;
}

.topbar-user {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.topbar-balance {
    background: var(--blue);
    color: #fff;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
}

.main-content {
    width: 100%;
    flex: 1;
    min-height: calc(100vh - 130px);
    padding: 28px 26px 42px;
}

.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 17px 26px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.site-footer p {
    margin: 0;
}

.sidebar-visible:after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.42);
    z-index: 40;
}

/* TYPOGRAPHY */

h1, h2, h3, h4 {
    line-height: 1.25;
    letter-spacing: -.5px;
    margin-top: 0;
}

h1 {
    font-size: 30px;
    font-weight: 800;
}

h2 {
    font-size: 24px;
    font-weight: 750;
}

h3 {
    font-size: 18px;
    font-weight: 700;
}

p {
    color: var(--muted);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.page-header h1 {
    margin: 0 0 8px;
}

.page-header p {
    margin: 0;
}

/* CARDS */

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-body {
    padding: 24px;
}

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

.card-header h3 {
    margin: 0;
}

.card-header p {
    margin: 5px 0 0;
}

.mt-4 {
    margin-top: 24px;
}

.text-muted {
    color: var(--muted);
}

/* BUTTONS */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 11px 17px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.btn-primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 5px 12px rgba(37,99,235,.18);
}

.btn-primary:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: #fff;
    border-color: var(--border);
    color: #334155;
}

.btn-outline:hover {
    border-color: #bfdbfe;
    background: var(--blue-soft);
    color: var(--blue);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: 9px;
}

/* FORMS */

input, select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dbe3ef;
    border-radius: 11px;
    background: #fff;
    outline: none;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px #dbeafe;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 7px;
}

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

/* TABLES */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.table th {
    background: #f8fafc;
    color: #64748b;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: .6px;
    font-weight: 700;
}

.table th, .table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.table td {
    color: #334155;
}

.table tbody tr:hover {
    background: #f8fbff;
}

/* BADGES */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 30px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.empty-state {
    text-align: center;
    padding: 42px 20px;
}

.empty-state h4 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;
}

/* WALLET */

.wallet-card {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    border: 0;
}

.wallet-card p {
    color: #dbeafe;
    margin: 0 0 8px;
}

.wallet-card h2 {
    font-size: 36px;
    color: #fff;
    margin: 0 0 22px;
}

.wallet-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wallet-card .btn-primary {
    background: #fff;
    color: #1d4ed8;
    box-shadow: none;
}

.wallet-card .btn-outline {
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}

/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 20px;
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
}

.stat-value {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.8px;
    margin: 0;
    color: var(--text);
}

.stat-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 5px;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0,1.6fr) minmax(280px,1fr);
    gap: 22px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-action {
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 17px;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 650;
    transition: .2s;
}

.quick-action:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
    transform: translateY(-2px);
}

.quick-action .stat-icon {
    flex-shrink: 0;
}

/* LOGIN / REGISTER */

.auth-wrap {
    max-width: 460px;
    margin: 25px auto;
}

.auth-card {
    padding: 34px;
}

.auth-title {
    text-align: center;
    margin-bottom: 28px;
}

.auth-title h1 {
    font-size: 27px;
    margin-bottom: 8px;
}

.auth-title p {
    margin: 0;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--muted);
}

.auth-card .btn {
    width: 100%;
}

/* COUNTRIES / SERVICES */

.country-grid, .service-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 15px;
}

.country-card, .service-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    color: #334155;
    transition: .2s;
}

.country-card:hover, .service-card:hover {
    border-color: #93c5fd;
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.country-card .flag {
    font-size: 30px;
    display: block;
    margin-bottom: 8px;
}

.country-card strong, .service-card strong {
    display: block;
}

/* RESPONSIVE */

@media(max-width:1000px) {
    :root {
        --sidebar-width: 225px;
    }

    .main-content {
        padding-left: 20px;
        padding-right: 20px;
    }

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

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

@media(max-width:760px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

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

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .topbar {
        padding: 0 15px;
    }

    .main-content {
        padding: 22px 14px 32px;
    }

    .site-footer {
        padding: 16px;
    }
}

@media(max-width:600px) {
    .container {
        width: calc(100% - 24px);
    }

    h1 {
        font-size: 25px;
    }

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

    .dashboard-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-value {
        font-size: 21px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 17px;
    }

    .card-body {
        padding: 18px;
    }

    .card-header {
        padding: 17px 18px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

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

    .auth-card {
        padding: 23px;
    }

    .wallet-card h2 {
        font-size: 30px;
    }

    .topbar-user {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
