/* ASN Teladan Selection System - Modern CSS Design System */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --secondary: #4f46e5;
    --success: #10b981;
    --success-light: #ecfdf5;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --info: #0ea5e9;
    --info-light: #e0f2fe;
    --dark: #1e293b;
    --gray-light: #f8fafc;
    --gray-border: #e2e8f0;
    --gray-text: #64748b;
    --white: #ffffff;
    --font: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font);
    background-color: #f1f5f9;
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* Auth Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(circle at 10% 20%, rgb(239, 246, 255) 0%, rgb(219, 234, 254) 100%);
}

.auth-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    border: 1px solid var(--gray-border);
    max-height: 95vh;
    overflow-y: auto;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo p {
    color: var(--gray-text);
    font-size: 0.875rem;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--dark);
    color: var(--white);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    color: var(--white);
    display: flex;
    flex-direction: column;
}

.sidebar-brand span {
    font-size: 0.75rem;
    color: var(--primary-light);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    border-radius: 0.75rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition);
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-menu li.active a {
    background: var(--primary);
}

.sidebar-user {
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-word;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-x: hidden;
}

.top-bar {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-shrink: 0;
    gap: 1rem;
}

.top-bar-title {
    font-size: 1.25rem;
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Components */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    border: 1px solid var(--gray-border);
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--gray-border);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: all var(--transition);
    background: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control:disabled {
    background: var(--gray-light);
    color: var(--gray-text);
    cursor: not-allowed;
}

/* File Input Normalization */
input[type="file"].form-control {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
}

input[type="file"].form-control::file-selector-button {
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid var(--gray-border);
    background: var(--gray-light);
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
    cursor: pointer;
    margin-right: 0.75rem;
    transition: all var(--transition);
}

input[type="file"].form-control::file-selector-button:hover {
    background: var(--gray-border);
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Checkbox styling */
input[type="checkbox"] {
    accent-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.95rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    gap: 0.5rem;
    white-space: nowrap;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    color: var(--white);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
    border: 1px solid var(--gray-border);
}

.btn-secondary:hover {
    background: var(--gray-border);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: var(--info-light);
    color: #0369a1;
    border: 1px solid #bae6fd;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

.table th {
    background: var(--gray-light);
    padding: 1rem;
    font-weight: 600;
    color: var(--gray-text);
    border-bottom: 1px solid var(--gray-border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-border);
    color: var(--dark);
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: rgba(248, 250, 252, 0.5);
}

/* Action column - prevent wrapping */
.table td:last-child {
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: #065f46;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-primary {
    background: var(--primary-light);
    color: #1e40af;
}

.badge-info {
    background: var(--info-light);
    color: #0369a1;
}

.badge-secondary {
    background: #e2e8f0;
    color: #475569;
}

/* Grid & Dashboard layout blocks */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}

/* Stats */
.stat-card {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-text);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--dark);
    margin-top: 0.25rem;
}

/* Stage Progress Bar */
.stages-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    background: var(--white);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-border);
    overflow-x: auto;
}

.stage-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.stage-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-border);
    color: var(--gray-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all var(--transition);
}

.stage-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-text);
    white-space: nowrap;
}

.stage-item.active .stage-number {
    background: var(--primary);
    color: var(--white);
}

.stage-item.active .stage-name {
    color: var(--primary);
    font-weight: 700;
}

.stage-item.completed .stage-number {
    background: var(--success);
    color: var(--white);
}

.stage-item.completed .stage-name {
    color: var(--success);
}

.stage-divider {
    flex-grow: 1;
    height: 2px;
    background: var(--gray-border);
    min-width: 20px;
}

/* ============================================================
   REUSABLE UTILITY CLASSES
   (Replaces common inline styles for consistency & responsive)
   ============================================================ */

/* Profile/Biodata Label-Value pairs */
.profile-label {
    font-size: 0.8rem;
    color: var(--gray-text);
    font-weight: 600;
    text-transform: uppercase;
}

.profile-value {
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 0.25rem;
    word-break: break-word;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.progress-track {
    width: 100%;
    height: 10px;
    background: var(--gray-border);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.progress-fill-primary {
    background: var(--primary);
}

.progress-fill-success {
    background: var(--success);
}

/* Score Display Cards */
.score-card {
    background: var(--gray-light);
    padding: 1.25rem;
    border-radius: 0.75rem;
}

.score-label {
    font-size: 0.8rem;
    color: var(--gray-text);
    display: block;
    text-transform: uppercase;
    font-weight: 600;
}

.score-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.3;
}

/* Section Headers */
.section-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-subtitle {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* Flex Actions Row */
.flex-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Inline Form Row (horizontal layout that stacks on mobile) */
.form-inline-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

/* Sub-aspect panel */
.sub-aspect-panel {
    border: 1px solid var(--gray-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
    background: var(--gray-light);
}

.sub-aspect-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    border-bottom: 1px dashed var(--gray-border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

/* Info Panel */
.info-panel {
    background: #fff;
    border: 1px solid var(--gray-border);
    padding: 1rem;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Text Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--gray-text); }
.text-italic { font-style: italic; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

/* Margin/Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--gray-text);
    font-style: italic;
}

/* Sidebar Toggle & Overlay */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark);
    padding: 0.25rem;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 998;
}

.sidebar-open .sidebar-overlay {
    display: block;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Large desktop: 1440px+ — default styles apply */

/* Desktop: 1024px - 1439px */
@media (max-width: 1439px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet: 768px - 1023px */
@media (max-width: 1023px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-inline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline-row .form-group {
        max-width: 100% !important;
    }

    .form-inline-row .btn {
        align-self: flex-start;
    }
}

/* Mobile landscape & small tablet: 640px - 767px */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        height: 100%;
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        width: 280px;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: inline-flex;
    }

    .dashboard-layout {
        flex-direction: column;
    }

    .main-content {
        width: 100%;
    }

    .top-bar {
        padding: 0 1rem;
        height: 60px;
    }

    .top-bar-title {
        font-size: 1rem;
    }

    .content-body {
        padding: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stages-flow {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 1rem;
    }

    .stage-divider {
        width: 2px;
        height: 16px;
        min-width: 2px;
        margin-left: 13px;
    }

    .table th,
    .table td {
        padding: 0.6rem 0.5rem;
        font-size: 0.82rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .auth-container {
        padding: 1rem;
    }

    .auth-card {
        padding: 1.75rem;
        max-height: 90vh;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-4 {
        grid-template-columns: 1fr;
    }

    .score-value {
        font-size: 1.35rem;
    }

    .score-card {
        padding: 1rem;
    }

    .sub-aspect-panel {
        padding: 1rem;
    }

    .sub-aspect-header {
        flex-direction: column;
    }

    .profile-value {
        font-size: 0.95rem;
    }
}

/* Mobile portrait: 480px and below */
@media (max-width: 480px) {
    .top-bar-actions {
        display: none;
    }

    .card-title {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .btn-sm {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }

    .btn {
        font-size: 0.82rem;
        padding: 0.5rem 0.85rem;
    }

    .content-body {
        padding: 0.75rem;
    }

    .card {
        padding: 1rem;
        border-radius: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
        font-size: 0.78rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    .auth-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }

    .auth-logo h1 {
        font-size: 1.5rem;
    }
}

/* Extra small: 320px */
@media (max-width: 360px) {
    .content-body {
        padding: 0.5rem;
    }

    .card {
        padding: 0.85rem;
    }

    .top-bar {
        padding: 0 0.75rem;
    }

    .btn {
        font-size: 0.78rem;
        padding: 0.45rem 0.7rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .form-control {
        font-size: 0.875rem;
        padding: 0.6rem 0.75rem;
    }
}

/* Custom Pagination styles to normalize large SVG arrows */
nav[role="navigation"] svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    display: inline-block;
    vertical-align: middle;
}
nav[role="navigation"] .flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
nav[role="navigation"] span.relative,
nav[role="navigation"] a.relative {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-border);
    border-radius: var(--radius);
    background-color: var(--white);
    color: var(--dark);
    margin: 0 2px;
    transition: all var(--transition);
}
nav[role="navigation"] a.relative:hover {
    background-color: var(--gray-light);
    color: var(--primary);
}
nav[role="navigation"] span.relative[aria-current="page"] {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

