:root {
    --brand-primary: #103b66;
    --brand-primary-dark: #091d5a;
    --brand-primary-light: #1c548a;
    --brand-accent: #009fe3;
    --brand-accent-hover: #0084c7;
    --brand-accent-light: #eaf4fb;
    --brand-success: #28a745;
    --brand-warning: #f59e0b;
    --brand-danger: #ef4444;
    --brand-dark: #0e1b2a;
    --brand-light: #f4f7fb;
    --brand-gray: #64748b;
    --brand-border: #e2e8f0;
    --brand-white: #ffffff;
    --sidebar-width: 270px;
    --card-shadow: 0 10px 25px -5px rgba(16, 59, 102, 0.08), 0 8px 10px -6px rgba(16, 59, 102, 0.04);
    --card-shadow-hover: 0 20px 30px -10px rgba(0, 159, 227, 0.2), 0 10px 15px -5px rgba(16, 59, 102, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--brand-dark);
    background-color: var(--brand-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    color: #ffffff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(9, 29, 90, 0.15);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-accent) 0%, #ffffff 150%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 159, 227, 0.4);
}

.sidebar-logo-img {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 159, 227, 0.4);
    background: #ffffff;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--brand-accent);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.8px;
}

.sidebar-menu {
    padding: 1.25rem 0.75rem;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.45);
    padding: 0.75rem 0.75rem 0.25rem;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.2rem;
    color: var(--brand-accent);
    transition: transform 0.2s ease;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-link:hover i {
    transform: scale(1.15);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--brand-accent) 0%, var(--brand-accent-hover) 100%);
    box-shadow: 0 4px 15px rgba(0, 159, 227, 0.35);
}

.sidebar-link.active i {
    color: #ffffff;
}

.sidebar-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}

/* Main Content Area */
.app-main {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.app-topbar {
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--brand-border);
    padding: 0 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-search {
    position: relative;
    max-width: 420px;
    width: 100%;
}

.topbar-search input {
    width: 100%;
    padding: 0.55rem 1rem 0.55rem 2.4rem;
    border-radius: 20px;
    border: 1px solid var(--brand-border);
    background-color: var(--brand-light);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.topbar-search input:focus {
    background-color: #ffffff;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(0, 159, 227, 0.15);
    outline: none;
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-gray);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Content */
.app-content {
    padding: 2rem 1.75rem;
    flex-grow: 1;
}

/* Axion Cards */
.ax-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
}

.ax-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.ax-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--brand-border);
}

.ax-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0;
}

/* KPI Widgets */
.kpi-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--brand-border);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}

.kpi-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.kpi-icon.primary { background: var(--brand-accent-light); color: var(--brand-primary); }
.kpi-icon.accent { background: #e0f2fe; color: var(--brand-accent); }
.kpi-icon.success { background: #dcfce7; color: var(--brand-success); }
.kpi-icon.warning { background: #fef3c7; color: var(--brand-warning); }

.kpi-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--brand-primary-dark);
    line-height: 1.1;
    margin-bottom: 2px;
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--brand-gray);
    font-weight: 500;
    margin: 0;
}

/* Buttons */
.btn-ax-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    box-shadow: 0 4px 12px rgba(16, 59, 102, 0.2);
    transition: all 0.2s ease;
}

.btn-ax-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary) 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 59, 102, 0.3);
}

.btn-ax-accent {
    background: linear-gradient(135deg, var(--brand-accent) 0%, var(--brand-accent-hover) 100%);
    color: #ffffff;
    border: none;
    font-weight: 600;
    border-radius: 10px;
    padding: 0.6rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 159, 227, 0.3);
    transition: all 0.2s ease;
}

.btn-ax-accent:hover {
    background: var(--brand-accent-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 159, 227, 0.4);
}

.btn-ax-outline {
    background: transparent;
    color: var(--brand-primary);
    border: 1.5px solid var(--brand-primary);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.55rem 1.2rem;
    transition: all 0.2s ease;
}

.btn-ax-outline:hover {
    background: var(--brand-accent-light);
    color: var(--brand-primary-dark);
    border-color: var(--brand-accent);
}

/* Status Badges */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-status.draft { background: #f1f5f9; color: #475569; }
.badge-status.sent { background: #e0f2fe; color: #0369a1; }
.badge-status.accepted, .badge-status.successful { background: #dcfce7; color: #15803d; }
.badge-status.declined, .badge-status.unsuccessful { background: #fee2e2; color: #b91c1c; }
.badge-status.expired { background: #fef3c7; color: #b45309; }

/* Autocomplete Box */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(16, 59, 102, 0.15);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1050;
    padding: 6px;
}

.autocomplete-item {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background-color 0.15s ease;
}

.autocomplete-item:hover, .autocomplete-item.active {
    background-color: var(--brand-accent-light);
}

.autocomplete-lang-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #334155;
    font-weight: 700;
}

/* PWA Install Banner */
.pwa-banner {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-accent) 100%);
    color: #ffffff;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    box-shadow: 0 6px 20px rgba(0, 159, 227, 0.3);
}

/* Responsive Mobile */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

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

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

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(14, 27, 42, 0.6);
        backdrop-filter: blur(4px);
        z-index: 1035;
    }
}
