:root {
    --bg: #F5F7FA;
    --panel: #ffffff;
    --text: #2C2C2C;
    --muted: #4b5563;
    --primary: #2E7D32;
    --secondary: #1E3A5F;
    --accent: #81C784;
    --primary-soft: #E8F5E9;
    --success: #2E7D32;
    --danger: #dc2626;
    --warning: #eab308;
    --info: #1E3A5F;
    --pending: #eab308;
    --border: #e5e7eb;
    --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    --radius: 14px;
    --green: #2E7D32;
    --green-hover: #256628;
    --green-light: #81C784;
    --green-lighter: #E8F5E9;
    --dark-gray: #2C2C2C;
    --gray: #4b5563;
    --light-gray: #6b7280;
    
    /* Auth page specific colors */
    --auth-gradient-start: #1a365d;
    --auth-gradient-end: #2E7D32;
    --auth-glass-bg: rgba(255, 255, 255, 0.92);
    --auth-glass-border: rgba(255, 255, 255, 0.3);
    --btn-gradient-start: #2E7D32;
    --btn-gradient-end: #43a047;
    --btn-gradient-hover-start: #256628;
    --btn-gradient-hover-end: #388e3c;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

a { color: inherit; text-decoration: none; }

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, var(--secondary) 0%, #152a45 100%);
    color: #ffffff;
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-backdrop {
    display: none;
}

.sidebar h2 {
    font-size: 18px;
    margin: 6px 8px 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255,255,255,0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 6px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--accent), var(--primary));
    transform: scaleY(0);
    transition: transform 0.25s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateX(4px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    color: var(--secondary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-link.active::before {
    transform: scaleY(1);
}

.main-content {
    display: grid;
    grid-template-rows: 90px 1fr;
    padding-top: 10px;
}

.topbar {
    background: linear-gradient(135deg, var(--secondary) 0%, #1e4a6f 100%);
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    position: sticky;
    top: 10px;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255,255,255,0.1);
    margin: 0 10px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-btn {
    display: none;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.page-content { padding: 20px; }

h2 {
    margin-top: 0;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

h3, h4, p, td, th {
    overflow-wrap: anywhere;
}

.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
}

.cards-grid > .card {
    flex: 0 1 calc(25% - 11px);
    min-width: 0;
}

.dashboard-stats-grid {
    margin-bottom: 4px;
}

.dashboard-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.dashboard-inline-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.progress-bar-wrap {
    height: 12px;
    width: 100%;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 999px;
    transition: width .25s ease;
}

.dashboard-activity-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.dashboard-activity-list li {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

.dashboard-pagination {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-page-link {
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font-weight: 600;
}

.dashboard-page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.dashboard-page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 8px;
}

.muted { color: var(--muted); }

.chart-wrap,
.table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-top: 16px;
    overflow-x: auto;
}

.chart-wrap {
    min-height: 320px;
}

.chart-wrap canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
}

.results-chart-wrap {
    min-height: 320px;
}

.results-chart-wrap canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 300px !important;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 14px;
}

th { color: var(--muted); font-weight: 600; }

.btn {
    border: none;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--btn-gradient-start), var(--btn-gradient-end));
    color: #fff;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--btn-gradient-hover-start), var(--btn-gradient-hover-end));
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.btn-soft {
    background: linear-gradient(135deg, var(--green-light), var(--accent));
    color: var(--green-hover);
    box-shadow: 0 2px 8px rgba(129, 199, 132, 0.3);
}
.btn-soft:hover {
    background: linear-gradient(135deg, var(--primary-soft), var(--green-light));
    color: var(--green-hover);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--green-hover));
    color: #fff;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}
.btn-success:hover {
    background: linear-gradient(135deg, var(--green-hover), #1b5e20);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, var(--info), #2563eb);
    color: #fff;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}
.btn-info:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #ca8a04);
    color: #fff;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #ca8a04, #a16207);
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.4);
}

/* Auth page specific button styles */
.auth-card .btn {
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    margin-bottom: 10px;
}

.auth-card .btn:last-child {
    margin-bottom: 0;
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid-elections {
    column-gap: 18px;
    row-gap: 14px;
}

.form-group { display: grid; gap: 7px; }

.required-indicator {
    color: var(--danger);
    font-weight: 700;
}

.party-tag-input-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 43px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.election-title-input {
    min-height: 43px;
}

.party-tag-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(129, 199, 132, 0.28);
}

.party-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.party-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--green-light);
    color: #14532d;
    font-weight: 600;
    font-size: 13px;
}

.party-tag-remove {
    border: none;
    background: transparent;
    color: #14532d;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.party-tag-remove:hover {
    color: #0f3d22;
}

.party-tag-input {
    flex: 1;
    min-width: 200px;
    border: none;
    outline: none;
    padding: 0 2px;
    background: transparent;
    line-height: 1.4;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    font: inherit;
    transition: all 0.2s ease;
}

input:not([type="radio"]):not([type="checkbox"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(129, 199, 132, 0.2);
    transform: translateY(-1px);
}

/* Auth page specific input styles */
.auth-card input {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 14px;
}

.auth-card .form-group label {
    font-weight: 600;
    color: var(--secondary);
    font-size: 14px;
}

.field-error {
    color: #b91c1c;
    font-size: 12px;
    font-weight: 600;
}

textarea { min-height: 110px; resize: vertical; }

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 18px;
    background: linear-gradient(135deg, var(--auth-gradient-start) 0%, #1e4d6b 50%, var(--auth-gradient-end) 100%);
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.auth-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(129, 199, 132, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(46, 125, 50, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(30, 58, 95, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.auth-card {
    width: min(430px, 100%);
    background: var(--auth-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid var(--auth-glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 32px 28px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.auth-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.auth-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.auth-card h2 {
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 4px;
}

.auth-branding {
    text-align: center;
    margin-bottom: 24px;
}

.auth-branding .logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--btn-gradient-start), var(--btn-gradient-end));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}

.auth-branding .brand-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    margin: 0 0 4px;
}

.auth-branding .brand-tagline {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    animation: alertSlideIn 0.3s ease;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.success {
    background: linear-gradient(135deg, var(--green-lighter) 0%, #c8e6c9 100%);
    color: #065f46;
    border-left: 4px solid var(--green);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.15);
}
.alert.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border-left: 4px solid var(--danger);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
}
.alert.warning {
    background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
    color: #854d0e;
    border-left: 4px solid var(--warning);
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.15);
}
.alert.info {
    background: linear-gradient(135deg, #e8eef6 0%, #dbeafe 100%);
    color: #1E3A5F;
    border-left: 4px solid var(--info);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.15);
}

.candidate-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.candidate-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.candidate-card h4 { margin: 12px 0 6px; }

/* User elections page specific styles */
label.candidate-card,
.vote-candidate-label {
    display: block;
    width: 100%;
    transition: all 0.3s ease;
    padding: 16px;
}

label.candidate-card:hover,
.vote-candidate-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

label.candidate-card input[type="radio"],
.vote-candidate-label input[type="radio"] {
    cursor: pointer;
}

.candidate-name {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.candidate-party {
    font-size: 16px;
    margin-top: 6px;
}

.candidate-select {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .candidate-name {
        font-size: 16px;
    }
    
    .candidate-party {
        font-size: 14px;
    }
    
    .candidate-select {
        font-size: 14px;
        gap: 8px;
    }
    
    .candidate-select input[type="radio"] {
        transform: scale(1.1);
    }
}

/* Submit vote button - appropriately sized */
.submit-vote-btn {
    width: 100%;
    font-size: 16px;
    padding: 14px 20px;
    min-height: 50px;
}

@media (max-width: 768px) {
    .submit-vote-btn {
        font-size: 14px;
        padding: 12px 16px;
        min-height: 44px;
    }
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.status-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.status-active { background: #E8F5E9; color: #1f5f24; border: 1px solid var(--green); }
.status-upcoming { background: #fef3c7; color: #92400e; border: 1px solid var(--warning); }
.status-completed { background: #e5e7eb; color: #374151; border: 1px solid #9ca3af; }

.notif-wrap { position: relative; }
.notif-btn {
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 42px;
    height: 42px;
    cursor: pointer;
    position: relative;
    font-size: 18px;
}

.notif-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.badge {
    position: absolute;
    top: -6px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    display: grid;
    place-items: center;
    padding: 0 4px;
}

.notif-dropdown {
    position: absolute;
    top: 50px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 340px;
    max-height: 320px;
    max-width: calc(100vw - 16px);
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 12px;
    display: none;
    z-index: 50;
}

.notif-dropdown.open {
    display: block;
}

.notif-dropdown h4 {
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.notif-dropdown ul { list-style: none; margin: 0; padding: 0; }
.notif-dropdown li {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
    line-height: 1.4;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
}

.modal-content {
    width: min(420px, 100%);
    background: #fff;
    border-radius: 14px;
    padding: 18px;
}

.modal-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Mobile breakpoint - <768px */
@media (max-width: 768px) {
    /* Sidebar - hamburger menu with overlay */
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        width: 280px;
        height: 100vh;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 90;
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    }
    .sidebar.open { transform: translateX(280px); }
    .menu-btn {
        display: inline-grid;
        place-items: center;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 80;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.show {
        display: block;
        opacity: 1;
    }

    /* Topbar adjustments */
    .topbar {
        padding: 12px 14px;
        min-height: 56px;
        gap: 10px;
        margin: 0 8px;
        top: 8px;
    }

    .topbar-right {
        gap: 10px;
    }

    .notif-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .user-chip {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 14px;
    }

    /* Main content */
    .main-content {
        grid-template-rows: auto 1fr;
    }

    .page-content {
        padding: 12px;
        overflow-x: hidden;
        width: 100%;
    }

    h2 {
        font-size: 22px;
    }

    /* Dashboard cards - single column, no horizontal overflow */
    .cards-grid {
        flex-direction: column;
    }
    .cards-grid > .card {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
    .candidate-grid { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .dashboard-grid-two { grid-template-columns: 1fr; }
    .dashboard-inline-stats { grid-template-columns: 1fr; }

    .card {
        padding: 14px;
    }

    /* Buttons - full width, stacked */
    .actions {
        flex-direction: column;
        gap: 10px;
    }

    .actions .btn,
    .actions a.btn {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 15px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    /* Tables - horizontally scrollable */
    .table-wrap {
        padding: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 600px;
    }

    .table-wrap .actions {
        flex-direction: column;
        gap: 8px;
    }

    .table-wrap .actions .btn,
    .table-wrap .actions a.btn {
        padding: 10px 14px;
        font-size: 13px;
        line-height: 1.4;
        border-radius: 10px;
        min-height: 44px;
    }

    .table-wrap .actions .compact-action-btn {
        padding: 10px 14px !important;
        font-size: 13px !important;
        line-height: 1.4 !important;
        border-radius: 10px !important;
    }

    .table-wrap th,
    .table-wrap td {
        overflow-wrap: normal;
        word-break: normal;
        font-size: 13px;
        padding: 12px 10px;
    }

    /* Charts - responsive */
    .chart-wrap {
        min-height: 280px;
        padding: 14px;
    }

    .chart-wrap canvas {
        width: 100% !important;
        height: 220px !important;
    }

    /* Candidate cards - better mobile display */
    .candidate-grid {
        gap: 16px;
    }

    .candidate-card img {
        height: 220px;
    }

    label.candidate-card {
        padding: 16px;
    }

    .results-chart-wrap {
        min-height: 280px;
        padding: 14px;
    }

    .results-chart-wrap h3 {
        font-size: 17px;
        line-height: 1.3;
        margin-top: 0;
    }

    .results-chart-wrap canvas {
        width: 100% !important;
        height: 220px !important;
    }

    /* Form elements */
    .form-grid { grid-template-columns: 1fr; }
    .form-group { margin-bottom: 4px; }
    .form-group label { font-size: 14px; margin-bottom: 6px; }

    input, select, textarea {
        padding: 12px 14px;
        font-size: 16px;
        min-height: 48px;
    }
    
    /* Keep radio buttons at default size */
    input[type="radio"] {
        min-height: auto;
        height: auto;
        padding: 0;
        width: auto;
    }

    /* Status pills */
    .status-pill {
        font-size: 11px;
        padding: 5px 10px;
        white-space: nowrap;
    }

    /* Notifications */
    .notif-dropdown {
        position: fixed;
        top: 72px;
        right: 12px;
        left: 12px;
        transform: none;
        width: auto;
        max-height: calc(100vh - 100px);
        border-radius: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }

    .notif-dropdown h4 {
        padding: 14px 16px;
        font-size: 15px;
    }

    .notif-dropdown li {
        padding: 12px 14px;
        font-size: 14px;
    }

    /* Candidate cards */
    .candidate-card img {
        height: 180px;
    }

    /* Modals */
    .modal-content {
        padding: 20px;
        border-radius: 16px;
    }

    .modal {
        padding: 20px;
    }

    /* Auth pages */
    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .auth-branding .logo {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .auth-branding .brand-title {
        font-size: 20px;
    }

    .auth-branding .brand-tagline {
        font-size: 12px;
    }
}

/* Tablet breakpoint - 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .cards-grid .card { flex: 0 1 calc(50% - 7px); }
    .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .analytics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid-two { grid-template-columns: 1fr; }
    .dashboard-inline-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Small mobile - <480px */
@media (max-width: 480px) {
    .page-content {
        padding: 10px;
    }

    .topbar {
        padding: 10px 12px;
        min-height: 52px;
        margin: 0 6px;
        top: 6px;
    }

    .menu-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .notif-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .user-chip {
        max-width: 100px;
        padding: 6px 12px;
        font-size: 13px;
    }

    h2 {
        font-size: 20px;
    }

    .card {
        padding: 12px;
        border-radius: 12px;
    }

    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .table-wrap {
        padding: 10px;
        border-radius: 12px;
    }

    .table-wrap th,
    .table-wrap td {
        font-size: 12px;
        padding: 10px 8px;
    }

    .table-wrap .actions .btn,
    .table-wrap .actions a.btn {
        padding: 9px 12px;
        font-size: 12px;
        min-height: 40px;
    }

    .status-pill {
        font-size: 10px;
        padding: 4px 8px;
    }

    .notif-dropdown {
        top: 64px;
        right: 8px;
        left: 8px;
        border-radius: 14px;
    }

    .notif-dropdown h4 {
        padding: 12px 14px;
        font-size: 14px;
    }

    .notif-dropdown li {
        padding: 10px 12px;
        font-size: 13px;
    }

    .modal-content {
        padding: 16px;
        border-radius: 14px;
    }

    .modal {
        padding: 16px;
    }

    input, select, textarea {
        padding: 11px 13px;
        font-size: 16px;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .auth-branding .logo {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .auth-branding .brand-title {
        font-size: 20px;
    }

    .auth-branding .brand-tagline {
        font-size: 12px;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .menu-btn,
    .notif-btn {
        -webkit-tap-highlight-color: rgba(46, 125, 50, 0.2);
    }

    .btn:active {
        transform: scale(0.97);
    }

    .nav-link:active {
        transform: scale(0.98);
    }

    input:focus,
    select:focus,
    textarea:focus {
        font-size: 16px;
    }
}

