:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-color: #1f2937;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-container {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, ring 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: var(--primary-hover);
}

.error-msg {
    color: #ef4444;
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    text-align: center;
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* General Grid Utilities */
.grid-stack {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-stack-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-stack-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {

    .grid-stack-2,
    .grid-stack-3 {
        grid-template-columns: 1fr;
    }
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
}

.sidebar {
    width: 280px;
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    position: fixed;
    height: 100vh;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 2.5rem;
    width: calc(100% - 280px);
    background-color: #f8fafc;
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-wrapper.no-sidebar .main-content {
    margin-left: 0;
    width: 100%;
}

.dashboard-wrapper.no-sidebar .mobile-toggle {
    display: none !important;
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        width: 250px;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 15px -3px rgba(0, 0, 0, 0.1);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1.5rem;
    }
}

.sidebar-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 0.75rem;
}

.nav-links a {
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
    gap: 0.75rem;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-links a.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1001;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.mobile-toggle:active {
    transform: scale(0.9);
}

@media (max-width: 1024px) {
    .mobile-toggle {
        display: flex;
    }
}


.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

/* Grid Layouts */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.stat-card {
    border-bottom: 4px solid var(--primary-color);
}

.stat-card h4 {
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f1f5f9;
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #1e293b;
    white-space: nowrap;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: #e0e7ff;
    color: #4338ca;
}

.badge-manager {
    background: #fef3c7;
    color: #92400e;
}

.badge-staff {
    background: #dcfce7;
    color: #166534;
}

.btn-danger {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
}

.btn-danger:hover {
    text-decoration: underline;
}

/* Selection Overlay */
.selection-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.selection-modal {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    width: 95%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    margin: 1rem;
}

@media (max-width: 576px) {
    .selection-modal {
        padding: 1.5rem;
    }

    .selection-modal h2 {
        font-size: 1.5rem;
    }
}

/* Premium Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-card h4 {
    color: #64748b;
    font-size: 0.875rem;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

.stat-card .value {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.chart-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
}

.btn-view {
    background: #eef2ff;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-view:hover {
    background: var(--primary-color);
    color: white;
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}



.selection-modal h2 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.selection-modal p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.selection-modal .form-group {
    margin-bottom: 1.5rem;
}

.btn-continue {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.btn-continue:hover {
    background: var(--primary-hover);
}

.btn-continue:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}

/* Staff Dashboard Specifics */
.form-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.form-section {
    border: 1px solid #f1f5f9;
    padding: 2rem;
    margin-bottom: 2.5rem;
    border-radius: 0.75rem;
    background: #ffffff;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #1e293b;
    font-size: 1.125rem;
    font-weight: 700;
    border-bottom: 2px solid #f8fafc;
    padding-bottom: 0.75rem;
}

.youth-table {
    width: 100%;
    border-collapse: collapse;
}

.youth-table th,
.youth-table td {
    border: 1px solid #f1f5f9;
    padding: 1rem;
    text-align: left;
    min-width: 120px;
    /* Default minimum width */
}

/* Specific column widths for better readability */
.youth-table th:nth-child(1),
.youth-table td:nth-child(1) {
    min-width: 250px;
}

/* Name */
.youth-table th:nth-child(2),
.youth-table td:nth-child(2) {
    min-width: 200px;
}

/* Education */
.youth-table th:nth-child(3),
.youth-table td:nth-child(3) {
    min-width: 100px;
}

/* Age */
.youth-table th:nth-child(4),
.youth-table td:nth-child(4) {
    min-width: 120px;
}

/* KYP */
.youth-table th:nth-child(5),
.youth-table td:nth-child(5) {
    min-width: 140px;
}

/* Gender */
.youth-table th:nth-child(6),
.youth-table td:nth-child(6) {
    min-width: 180px;
}

/* Mobile */

.youth-table th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.875rem;
    color: #475569;
}

.youth-table input,
.youth-table select {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.btn-add-row {
    margin-top: 1.5rem;
    background: #10b981;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-add-row:hover {
    background: #059669;
}

.btn-submit {
    margin-top: 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    border: none;
    padding: 1.25rem;
    border-radius: 0.5rem;
    width: 100%;
    font-weight: 700;
    cursor: pointer;
    font-size: 1.125rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
    transition: all 0.2s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    filter: brightness(1.1);
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }

    /* Decrease table column padding and font size on mobile */
    .youth-table th,
    .youth-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .remark-input {
        font-size: 0.75rem;
        padding: 0.375rem;
    }

    .btn-save-remark {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }

    .status-badge {
        padding: 0.125rem 0.375rem;
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    .form-card {
        padding: 1.5rem;
    }

    .form-section {
        padding: 1.25rem;
    }
}

/* Premium Button Variations */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    border: none;
}

.btn-premium {
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3);
    filter: brightness(1.1);
}

.btn-outline {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
}

.btn-detail {
    background: #ffffff;
    color: #4f46e5;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8125rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid #eef2ff;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-detail:hover {
    background: #f5f8ff;
    border-color: #c7d2fe;
    transform: translateX(4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}