/* ============================================================
   1. GLOBAL VARIABLES & RESET
   ============================================================ */
:root {
    --navy: #193050;
    --light-blue: #51a6dc;
    --gray-bg: #f4f5f7;
    --white: #ffffff;
    --border-color: #dee2e6;
    --text-dark: #222222;
    --text-muted: #555555;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--gray-bg);
    color: var(--text-dark);
}

/* ============================================================
   2. DASHBOARD LAYOUT (The Modern Sidebar Structure)
   ============================================================ */
.portal-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.portal-sidebar {
    width: 260px;
    background-color: var(--navy);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-logo {
    background-color: var(--navy); 
    padding: 25px 20px;
    text-align: center;
    /* 🚩 Change this line to 'none' to remove the ghost line */
    border-bottom: none !important; 
    /* This ensures no extra space is pushing the nav down */
    margin-bottom: 0; 
}

.sidebar-logo img {
    height: 65px;                  /* Adjusted height to match your sample pic */
    width: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-nav { flex-grow: 1; padding-top: 20px; }

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    /* This ensures the first link touches the logo area perfectly */
    border-top: none; 
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    /* 🚩 This property is the gold standard for spacing icons and text */
    gap: 12px;             
    padding: 15px 25px;
    color: #bfc5d1;
    text-decoration: none;
    font-size: 0.95rem;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.sidebar-nav li a:hover, 
.sidebar-nav li.active a {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border-left: 4px solid var(--light-blue);
}

.sidebar-nav i {
    width: 18px;
    height: 18px;
    /* 🚩 Remove margin-right if you use 'gap' above */
    margin-right: 0;       
    flex-shrink: 0;
    color: #bfc5d1;
}

.sidebar-nav li.active i, 
.sidebar-nav li a:hover i {
    color: var(--light-blue); /* Highlights the icon when active */
}

/* ============================================================
   3. MAIN CONTENT & HEADER
   ============================================================ */
.main-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-header {
    background: var(--white);
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 25px;
    border-bottom: 1px solid var(--border-color);
}

.page-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

/* ============================================================
   4. TABS (The Navigation Bar)
   ============================================================ */
.portal-tabbar {
    background-color: #adb2bd; /* Dark Gray from your snippet */
    padding: 0 20px;
}

.tabbar-inner {
    display: flex;
    justify-content: flex-end; 
    gap: 6px;      /* 🚩 This adds the space back between each tab */
    padding: 0 40px;
}

.portal-tab {
    padding: 12px 20px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    margin-top: 8px;
    background: rgba(255,255,255,0.3);
}

.portal-tab.active {
    background-color: var(--gray-bg);
    border-top: 3px solid var(--light-blue);
}

/* ============================================================
   5. CARDS & ALERTS (Announcements)
   ============================================================ */
.portal-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Announcement Banner Style */
.portal-announcement {
    background: #fff9db; 
    border-left: 6px solid #fcc419; 
    padding: 20px; 
    margin-bottom: 25px; 
    border-radius: 8px;
    display: flex;
    gap: 15px;
}

/* ============================================================
   6. FORMS & BUTTONS
   ============================================================ */
.form-row label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 6px;
}

.form-row input, .form-row select, .form-row textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
}

.portal-button {
    background: var(--navy);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

/* ============================================================
   7. DJANGO ADMIN OVERRIDES (To match portal)
   ============================================================ */
#header, .breadcrumbs {
    background: var(--navy) !important;
    color: var(--white) !important;
}

#header a, .breadcrumbs a { color: var(--white) !important; }

/* ===== Footer Styling ===== */
.portal-footer {
    background-color: var(--navy);
    color: var(--white);
    padding: 30px 40px;
    display: flex;             /* 🚩 Activates Flexbox */
    justify-content: space-between; /* 🚩 Pushes items to far left and far right */
    align-items: center;       /* 🚩 Centers text vertically */
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-left {
    text-align: left;
}

.footer-left strong {
    font-size: 1rem;
    color: var(--light-blue);
    display: block;
    margin-bottom: 4px;
}

.footer-right {
    text-align: right;         /* 🚩 Ensures text lines up on the right edge */
    opacity: 0.8;
    line-height: 1.6;
}

/* portal.css */
.todo-item {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
}

/* This replaces the inline IF logic */
.todo-item.is-completed {
    background: #f8fafc;
    opacity: 0.7;
}

.todo-title {
    font-weight: 600;
    font-size: 1rem;
    color: #1e293b;
}

.todo-title.strikethrough {
    text-decoration: line-through;
}

/* This handles the look of completed items without using inline styles */
.todo-item.is-completed {
    background-color: #f8fafc;
    opacity: 0.7;
}

.todo-title.strikethrough {
    text-decoration: line-through;
    color: #94a3b8 !important;
}

.tax-year-badge {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-container {
    background: #e2e8f0; 
    border-radius: 999px; 
    height: 12px; 
    margin-bottom: 10px; 
    overflow: hidden;
}

.progress-bar {
    background: #22c55e;
    height: 100%;
    transition: width 0.5s ease;
    /* This line uses the variable we set in the HTML */
    width: var(--progress, 0%); 
}

/* Core Progress Bar Styling */
#tax-progress-bar {
    height: 100%;
    min-height: 14px;
    border-radius: 999px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.5s ease;
}

/* Status Color Definitions */
/* We use !important to ensure these override any default bar colors */
.status-danger { 
    background-color: #ef4444 !important; 
    color: #ef4444 !important; 
}
.status-warning { 
    background-color: #f59e0b !important; 
    color: #f59e0b !important; 
}
.status-success { 
    background-color: #22c55e !important; 
    color: #22c55e !important; 
}

/* Base title style */
.todo-title {
    font-weight: 600;
    color: #0f172a; /* Default Dark Color */
}

/* Strikethrough style also handles the color change */
.todo-title.strikethrough {
    text-decoration: line-through;
    color: #94a3b8; /* Faded Gray Color for completed tasks */
}

/* Checklist Text States */
.status-active { color: #0f172a; }
.status-completed { color: #94a3b8; text-decoration: line-through; }

/* Due Date Badges */
.due-badge { background: #f1f5f9; color: #64748b; }
.due-badge.overdue { background: #fee2e2; color: #ef4444; font-weight: bold; }