/* Brand palette (matches the logo green) */
:root{
    --brand-green:#0B7A3B;
    --brand-green-dark:#075B2B;
    --brand-green-light:#17A34A;

    --bg:#F8FAFC;
    --card:#FFFFFF;
    --border:#E5E7EB;
    --text:#0F172A;
    --muted:#64748B;
    --success-soft:#ECFDF3;
    --success-border:#BBF7D0;
    --shadow-sm:0 2px 5px rgba(0,0,0,0.1);
    --shadow-md:0 12px 28px rgba(15,23,42,0.08);
    --shadow-lg:0 24px 56px rgba(15,23,42,0.22);
}

@keyframes appFadeIn {
    from{
        opacity:0;
    }

    to{
        opacity:1;
    }
}

@keyframes appFadeUp {
    from{
        opacity:0;
        transform:translateY(12px);
    }

    to{
        opacity:1;
        transform:translateY(0);
    }
}

@keyframes logoPulse {
    0%{
        box-shadow:0 0 0 0 rgba(255,255,255,0.34), 0 8px 18px rgba(0,0,0,0.14);
    }

    70%{
        box-shadow:0 0 0 12px rgba(255,255,255,0), 0 8px 18px rgba(0,0,0,0.14);
    }

    100%{
        box-shadow:0 0 0 0 rgba(255,255,255,0), 0 8px 18px rgba(0,0,0,0.14);
    }
}

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

a{
    color:var(--brand-green-dark);
}

button,
.app-button,
.dashboard-form-actions button,
.dashboard-shortcut,
.records-action-link,
.record-view-link,
.record-primary-button,
.record-secondary-button,
.record-danger-button,
.search-button,
.view-record-link,
.modal-button,
.reports-action-link,
.reports-modal-button,
.user-primary-button,
.user-modal-button{
    border-radius:8px;
    font-family:inherit;
}

button{
    transition:transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

button:hover,
.app-button:hover{
    transform:translateY(-2px);
}

/* Sidebar */

.sidebar{
    width:220px;
    height:100vh;
    background:linear-gradient(180deg, var(--brand-green-dark) 0%, #06451f 100%);
    color:white;
    position:fixed;
    display:flex;
    flex-direction:column;
    box-shadow:8px 0 24px rgba(15,23,42,0.16);
    animation:appFadeIn 0.28s ease both;
    z-index:20;
}

.sidebar-brand{
    display:flex;
    flex-direction:column;
    align-items:center;
    padding:18px 16px 12px;
    border-bottom:1px solid rgba(255,255,255,0.12);
}

.sidebar-logo{
    /* Keep the logo controlled inside the fixed sidebar. */
    width:56px !important;
    height:56px !important;
    max-width:56px !important;
    max-height:56px !important;
    object-fit:contain;
    object-position:center;
    display:block;
    flex:0 0 auto;
    margin-bottom:10px;
    padding:8px;
    border-radius:50%;
    background:#ffffff;
    border:2px solid rgba(255,255,255,0.72);
    filter:drop-shadow(0 4px 8px rgba(0,0,0,0.16));
    animation:logoPulse 2.4s ease-out infinite;
    transition:transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-brand:hover .sidebar-logo{
    transform:scale(1.07);
    box-shadow:0 10px 22px rgba(0,0,0,0.18);
}

.sidebar h2{
    text-align:center;
    padding:0;
    margin:0;
    font-size:16px;
    line-height:1.2;
    font-weight:700;
}

.sidebar ul{
    list-style:none;
    padding:10px 10px 12px;
    margin:0;
    display:flex;
    flex-direction:column;
    flex:1;
    gap:4px;
}

.sidebar ul li{
    padding:0;
    border-radius:8px;
    position:relative;
    overflow:hidden;
    animation:appFadeUp 0.28s ease both;
    transition:background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.sidebar ul li.active,
.sidebar ul li a.active{
    background:rgba(23,163,74,0.34);
    box-shadow:inset 4px 0 0 #86efac;
}

/* Push the last item (Logout) to the very bottom */
.sidebar ul li:last-child{
    margin-top:auto;
}

.sidebar ul li a{
    color:white;
    text-decoration:none;
    display:flex;
    align-items:center;
    min-height:42px;
    padding:0 14px;
    border-radius:8px;
    transition:transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.sidebar ul li:hover{
    background:rgba(255,255,255,0.12);
    transform:translateX(4px);
    box-shadow:0 8px 18px rgba(0,0,0,0.12);
}

.sidebar ul li:hover a{
    color:#f8fafc;
}

.sidebar ul li:last-child a{
    color:#dcfce7;
}

.sidebar ul li:last-child:hover{
    background:rgba(220,38,38,0.2);
    box-shadow:0 8px 18px rgba(127,29,29,0.18);
}

/* Main Area */

.main{
    margin-left:220px;
    padding:20px;
}

.topbar{
    margin-bottom:20px;
}

/* Cards */

.cards{
    display:flex;
    gap:20px;
}

.card{
    background:var(--card);
    padding:20px;
    flex:1;
    border-radius:8px;
    box-shadow:var(--shadow-sm);
    border:1px solid var(--border);
}

.card h3{
    margin:0;
}

.card p{
    font-size:24px;
    font-weight:bold;
}

/* Table */

.table-section{
    margin-top:30px;
    background:var(--card);
    padding:20px;
    border-radius:8px;
    border:1px solid var(--border);
}

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

table th, table td{
    padding:12px;
    border-bottom:1px solid #ddd;
}

table th{
    background:#F3F4F6;
}

/* User management table alignment */
.users-table th,
.users-table td{
    text-align:center;
}

/* Shared confirmation modal */
.app-modal-backdrop{
    position:fixed;
    inset:0;
    display:none;
    align-items:center;
    justify-content:center;
    padding:20px;
    background:rgba(15,23,42,0.46);
    z-index:100;
}

.app-modal-backdrop.is-open{
    display:flex;
    animation:appFadeIn 0.18s ease both;
}

.app-modal{
    width:min(100%,430px);
    padding:22px;
    border-radius:8px;
    background:#fff;
    border:1px solid #e2e8f0;
    box-shadow:var(--shadow-lg);
    animation:appFadeUp 0.22s ease both;
}

.app-modal h2{
    margin:0 0 8px;
    font-size:20px;
}

.app-modal p{
    margin:0;
    color:var(--muted);
    line-height:1.5;
}

.app-modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:20px;
}

.app-modal-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:40px;
    padding:0 16px;
    border-radius:8px;
    border:1px solid transparent;
    font-size:14px;
    font-weight:700;
    text-decoration:none;
    cursor:pointer;
    transition:transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.app-modal-button-primary{
    color:#fff;
    background:var(--brand-green);
    border-color:var(--brand-green);
}

.app-modal-button-primary:hover{
    background:var(--brand-green-dark);
    box-shadow:0 10px 22px rgba(11,122,59,0.22);
}

.app-modal-button-secondary{
    color:var(--brand-green-dark);
    background:var(--success-soft);
    border-color:var(--success-border);
}

.app-modal-button-secondary:hover{
    color:#fff;
    background:var(--brand-green);
    box-shadow:0 8px 18px rgba(11,122,59,0.18);
}
