:root {
    --uwase-primary: #0d6e46;
    --uwase-primary-dark: #08482e;
    --uwase-primary-light: #eaf6f0;
    --uwase-primary-border: #a3d9be;
    
    --uwase-secondary: #1a2e40;
    --uwase-secondary-dark: #0f1f2e;
    --uwase-secondary-light: #f0f4f8;
    
    --uwase-accent: #d4af37;
    --uwase-accent-dark: #b8972e;
    --uwase-accent-light: #fcf8eb;
    
    --uwase-gold-gradient: linear-gradient(135deg, #d4af37 0%, #f3e099 50%, #b8972e 100%);
    --uwase-green-gradient: linear-gradient(135deg, #0d6e46 0%, #08482e 100%);
    --uwase-header-gradient: linear-gradient(135deg, #0d2818 0%, #1a2e40 60%, #0d6e46 100%);
    
    --uwase-bg: #f8fafc;
    --uwase-surface: #ffffff;
    --uwase-text: #1e293b;
    --uwase-text-muted: #64748b;
    
    --sidebar-width: 270px;
    --topbar-height: 68px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.03);
    --shadow-card: 0 12px 24px -6px rgba(13, 110, 70, 0.08), 0 4px 10px rgba(0,0,0,0.03);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--uwase-bg);
    color: var(--uwase-text);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   AUTH / LOGIN PAGE STYLES
   ========================================================================== */
.auth-body {
    background: radial-gradient(circle at top right, rgba(13, 110, 70, 0.22) 0%, transparent 50%),
                radial-gradient(circle at bottom left, rgba(26, 46, 64, 0.3) 0%, transparent 60%),
                linear-gradient(135deg, #091a13 0%, #102433 50%, #0d422b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem 1rem;
}

.auth-body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(rgba(212, 175, 55, 0.08) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.auth-wrapper {
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 10;
    animation: authFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    position: relative;
}

.auth-card-topbar {
    height: 6px;
    background: var(--uwase-gold-gradient);
}

.auth-card-body {
    padding: 2.25rem 2.25rem 2rem 2.25rem;
}

.auth-logo-wrapper {
    width: 96px;
    height: 96px;
    margin: 0 auto 1.25rem auto;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 10px 25px rgba(13, 110, 70, 0.18), 0 0 0 4px rgba(212, 175, 55, 0.25);
    border: 2px solid var(--uwase-accent);
    position: relative;
}

.auth-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-title {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--uwase-primary);
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.auth-subtitle {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--uwase-secondary);
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.auth-slogan-badge {
    display: inline-block;
    background: var(--uwase-accent-light);
    color: #926f0e;
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 0.35rem 0.95rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.auth-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--uwase-primary);
    font-size: 1.15rem;
    z-index: 5;
    transition: color 0.2s;
}

.auth-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.85rem;
    font-size: 0.95rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    color: var(--uwase-text);
    transition: all 0.2s ease;
}

.auth-input:focus {
    background-color: #ffffff;
    border-color: var(--uwase-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(13, 110, 70, 0.15);
}

.auth-input-password {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--uwase-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: color 0.2s;
}

.auth-password-toggle:hover {
    color: var(--uwase-primary);
}

.btn-auth-submit {
    width: 100%;
    padding: 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    background: var(--uwase-green-gradient);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 16px rgba(13, 110, 70, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.25s ease;
    margin-top: 0.75rem;
}

.btn-auth-submit:hover {
    background: linear-gradient(135deg, #0a5838 0%, #063522 100%);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(13, 110, 70, 0.4);
    transform: translateY(-1px);
}

.btn-auth-submit:active {
    transform: translateY(0);
}

.auth-card-footer {
    background: #f8fafc;
    border-top: 1px solid #edf2f7;
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    color: var(--uwase-text-muted);
    text-align: center;
}

/* ==========================================================================
   MAIN DASHBOARD & APP LAYOUT
   ========================================================================== */
.app-wrapper {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--uwase-secondary-dark) 0%, var(--uwase-secondary) 40%, var(--uwase-primary-dark) 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    background: rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header img {
    height: 44px;
    width: 44px;
    object-fit: contain;
    margin-right: 12px;
    border-radius: 50%;
    background: #ffffff;
    padding: 3px;
    border: 1.5px solid var(--uwase-accent);
}

.sidebar-header .brand-text {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: #ffffff;
}

.sidebar-header .brand-text small {
    display: block;
    font-size: 0.72rem;
    color: var(--uwase-accent);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.5rem;
    list-style: none;
    margin: 0;
}

.sidebar-nav-item {
    margin-bottom: 0.2rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1.15rem;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.sidebar-nav-link:hover {
    background: rgba(255,255,255,0.09);
    color: #ffffff;
    transform: translateX(3px);
}

.sidebar-nav-link.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 0.05) 100%);
    color: #ffffff;
    font-weight: 700;
    border-left: 4px solid var(--uwase-accent);
}

.sidebar-nav-link i {
    margin-right: 12px;
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    color: var(--uwase-accent);
}

.nav-section-title {
    padding: 1.2rem 1.15rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.45);
    font-weight: 700;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    background: rgba(0,0,0,0.25);
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.85rem;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-topbar {
    height: var(--topbar-height);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-toggler {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--uwase-secondary);
    cursor: pointer;
    display: none;
}

.page-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--uwase-secondary);
    letter-spacing: -0.2px;
}

.app-content {
    flex: 1;
    padding: 1.75rem;
    overflow-y: auto;
    background: var(--uwase-bg);
}

/* ==========================================================================
   CARDS & STATS (KPIs)
   ========================================================================== */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    border: 1px solid #edf2f7;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 5px;
    background: var(--uwase-primary);
}

.stat-card.stat-gold::after { background: var(--uwase-accent); }
.stat-card.stat-navy::after { background: var(--uwase-secondary); }
.stat-card.stat-danger::after { background: #dc2626; }
.stat-card.stat-info::after { background: #0284c7; }

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--uwase-primary-light);
    color: var(--uwase-primary);
}

.card-custom {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid #edf2f7;
    margin-bottom: 1.75rem;
    overflow: hidden;
}

.card-custom .card-header {
    background: #ffffff;
    border-bottom: 1px solid #edf2f7;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--uwase-secondary);
    padding: 1.15rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn-uwase {
    background: var(--uwase-green-gradient);
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.55rem 1.25rem;
    box-shadow: 0 2px 6px rgba(13, 110, 70, 0.25);
    transition: all 0.2s ease;
}

.btn-uwase:hover {
    background: linear-gradient(135deg, #0a5838 0%, #063522 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 70, 0.35);
}

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

.btn-uwase-outline:hover {
    background: var(--uwase-primary);
    color: #ffffff;
}

.btn-accent {
    background: var(--uwase-gold-gradient);
    color: #ffffff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.55rem 1.25rem;
    box-shadow: 0 2px 6px rgba(212, 175, 55, 0.3);
}

.btn-accent:hover {
    background: linear-gradient(135deg, #c59b27 0%, #a4811b 100%);
    color: #ffffff;
    transform: translateY(-1px);
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-uwase {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table-uwase th {
    background: #f8fafc;
    color: var(--uwase-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
    padding: 1rem 1.25rem;
    border-bottom: 2px solid #e2e8f0;
}

.table-uwase td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #edf2f7;
    font-size: 0.92rem;
}

.table-uwase tbody tr {
    transition: background-color 0.15s ease;
}

.table-uwase tbody tr:hover {
    background-color: #f1f8f4;
}

/* Status Badges */
.badge-status-active { background-color: #10b981; color: white; }
.badge-status-dormant { background-color: #f59e0b; color: white; }
.badge-status-inactive { background-color: #ef4444; color: white; }
.badge-status-deceased { background-color: #475569; color: white; }

/* Responsive adjustments */
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.show { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-toggler { display: block; }
    .sidebar-overlay {
        position: fixed;
        top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 1035;
        display: none;
    }
    .sidebar-overlay.show { display: block; }
}

@media print {
    .app-sidebar, .app-topbar, .btn, .sidebar-overlay, form { display: none !important; }
    .app-main { margin: 0 !important; }
    .app-content { background: white !important; padding: 0 !important; }
    .card-custom { box-shadow: none !important; border: none !important; }
    body { background: white; }
    @page { size: A4 landscape; margin: 1cm; }
    .print-portrait @page { size: A4 portrait; }
}
