/* =============================================
   SIAKAD - Tema Biru Pastel Elegan
   ============================================= */

:root {
    --primary: #4A90C2;
    --primary-dark: #2C5F8D;
    --primary-darker: #1E4263;
    --primary-light: #A8C5E6;
    --primary-lighter: #E8F1FA;
    --primary-ghost: #F5F9FC;
    --accent: #6BA5D4;
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-500: #6B7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --shadow-sm: 0 1px 2px rgba(44, 95, 141, 0.05);
    --shadow: 0 4px 6px -1px rgba(44, 95, 141, 0.08), 0 2px 4px -1px rgba(44, 95, 141, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(44, 95, 141, 0.1), 0 4px 6px -2px rgba(44, 95, 141, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(44, 95, 141, 0.1), 0 10px 10px -5px rgba(44, 95, 141, 0.04);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-ghost);
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    color: var(--primary-darker);
    font-weight: 600;
    letter-spacing: -0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4A90C2 0%, #2C5F8D 50%, #1E4263 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(168,197,230,0.15) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    border-radius: 50%;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 10px 25px -5px rgba(74, 144, 194, 0.4);
}

.login-logo-icon svg {
    width: 36px;
    height: 36px;
    fill: white;
}

.login-logo h1 {
    font-size: 24px;
    color: var(--primary-darker);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 13px;
    color: var(--gray-500);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.login-tabs {
    display: flex;
    background: var(--primary-lighter);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.login-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
    border: none;
}

.login-tab.active {
    background: var(--white);
    color: var(--primary-dark);
    box-shadow: var(--shadow-sm);
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 194, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234A90C2' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px -2px rgba(74, 144, 194, 0.4);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px -2px rgba(74, 144, 194, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: white;
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #D97706 100%);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
}

.btn-icon {
    padding: 8px;
    width: 34px;
    height: 34px;
}

/* =============================================
   LAYOUT - DASHBOARD
   ============================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-darker) 0%, var(--primary-dark) 100%);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.sidebar-header {
    padding: 24px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.sidebar-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-subtitle {
    font-size: 11px;
    opacity: 0.65;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.sidebar-role-badge {
    margin: 20px 22px 8px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-light);
}

.sidebar-role-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.sidebar-role-name {
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

.sidebar-menu {
    padding: 12px 14px;
    flex: 1;
}

.sidebar-menu-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.5;
    padding: 12px 8px 8px;
    font-weight: 600;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.8);
    margin-bottom: 3px;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
}

.sidebar-menu-item:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar-menu-item.active {
    background: rgba(255,255,255,0.14);
    color: white;
    box-shadow: inset 3px 0 0 var(--primary-light);
}

.sidebar-menu-item svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
}

.sidebar-footer a:hover {
    background: rgba(239, 68, 68, 0.15);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--primary-ghost);
}

.topbar {
    background: white;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--gray-100);
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-darker);
}

.topbar-breadcrumb {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-user-info {
    text-align: right;
}

.topbar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.topbar-user-role {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: capitalize;
}

.topbar-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.page-content {
    padding: 28px 32px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 24px;
    color: var(--primary-darker);
    font-weight: 700;
}

.page-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--gray-100);
}

.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--primary-ghost);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-darker);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-lighter) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-title-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--primary-dark);
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-card.success::before { background: linear-gradient(180deg, var(--success) 0%, #059669 100%); }
.stat-card.warning::before { background: linear-gradient(180deg, var(--warning) 0%, #D97706 100%); }
.stat-card.info::before { background: linear-gradient(180deg, var(--info) 0%, #2563EB 100%); }

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-lighter);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    fill: var(--primary-dark);
}

.stat-card.success .stat-icon { background: var(--success-light); }
.stat-card.success .stat-icon svg { fill: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); }
.stat-card.warning .stat-icon svg { fill: var(--warning); }
.stat-card.info .stat-icon { background: var(--info-light); }
.stat-card.info .stat-icon svg { fill: var(--info); }

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-darker);
    line-height: 1.1;
}

.stat-caption {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* =============================================
   TABLE
   ============================================= */
.table-wrapper {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--primary-ghost);
    border-bottom: 2px solid var(--primary-lighter);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: 14px 16px;
    font-size: 13.5px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-100);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--primary-ghost);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 6px;
}

/* =============================================
   BADGES
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-primary {
    background: var(--primary-lighter);
    color: var(--primary-dark);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* =============================================
   ALERT / FLASH
   ============================================= */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success {
    background: var(--success-light);
    color: #065F46;
    border-color: var(--success);
}

.alert-danger {
    background: var(--danger-light);
    color: #991B1B;
    border-color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: #92400E;
    border-color: var(--warning);
}

.alert-info {
    background: var(--info-light);
    color: #1E40AF;
    border-color: var(--info);
}

/* =============================================
   FORMS
   ============================================= */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--gray-100);
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--gray-500);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    fill: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 6px;
    color: var(--gray-700);
}

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar .form-control {
    max-width: 240px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(30, 66, 99, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    color: var(--primary-darker);
}

.modal-body {
    padding: 22px 24px;
    font-size: 14px;
    color: var(--gray-700);
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
}

.welcome-card::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    border-radius: 50%;
}

.welcome-card h2 {
    color: white;
    font-size: 22px;
    margin-bottom: 6px;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 14px;
}

.welcome-info {
    display: flex;
    gap: 24px;
    margin-top: 18px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.welcome-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.welcome-info-item svg {
    width: 16px;
    height: 16px;
    fill: white;
    opacity: 0.9;
}

/* Jadwal / Matkul Card */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.schedule-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

.schedule-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.schedule-card.selected {
    border-left-color: var(--success);
    background: var(--success-light);
}

.schedule-card-top {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 12px;
}

.schedule-matkul {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary-darker);
    margin-bottom: 4px;
}

.schedule-kode {
    font-size: 11px;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

.schedule-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.schedule-detail svg {
    width: 14px;
    height: 14px;
    fill: var(--primary);
    flex-shrink: 0;
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 20px;
    }
    .topbar {
        padding: 14px 20px;
    }
}

/* Checkbox custom */
.checkbox-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
}

.checkbox-custom input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}