/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --success-dark: #38a169;
    --danger: #f56565;
    --danger-dark: #e53e3e;
    --warning: #ed8936;
    --warning-dark: #dd6b20;
    --info: #4299e1;
    --info-dark: #3182ce;
    --dark: #1a2030;
    --darker: #141828;
    --gray-50: #f8f9fa;
    --gray-100: #f0f2f5;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-500: #718096;
    --gray-700: #2d3748;
    --gray-900: #1a202c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-md: 0 10px 20px rgba(0,0,0,0.1);
    --shadow-lg: 0 20px 40px rgba(0,0,0,0.15);
    --radius: 10px;
    --radius-sm: 6px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== Login Page ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-box {
    background: #fff;
    border-radius: 16px;
    padding: 45px 40px;
    box-shadow: var(--shadow-lg);
}

.login-box .logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-box h1 {
    text-align: center;
    font-size: 22px;
    color: var(--gray-900);
    margin-bottom: 5px;
    font-weight: 700;
}

.login-box .subtitle {
    text-align: center;
    color: var(--gray-500);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-box .form-control {
    padding: 13px 16px;
    font-size: 15px;
}

.login-box .btn {
    padding: 13px;
    font-size: 15px;
    margin-top: 10px;
}

.login-box .credentials-info {
    margin-top: 20px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 12px;
    color: var(--gray-500);
}

/* ===== Layout / Sidebar ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, var(--dark) 0%, var(--darker) 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-header {
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
}

.sidebar-header .logo-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.sidebar-header h3 {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-header p {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 5px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 13px 22px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    margin: 3px 10px;
    border-radius: var(--radius-sm);
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateX(3px);
}

.sidebar-menu li a.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sidebar-menu li a .icon {
    margin-right: 12px;
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 25px;
    min-height: 100vh;
}

/* ===== Page Header ===== */
.page-header {
    background: #fff;
    padding: 22px 28px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    border-left: 4px solid var(--primary);
}

.page-header h2 {
    font-size: 22px;
    color: var(--gray-900);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header .date {
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 500;
    background: var(--gray-100);
    padding: 6px 14px;
    border-radius: 20px;
}

/* ===== Cards ===== */
.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-100);
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    font-size: 17px;
    color: var(--gray-900);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3::before {
    content: '';
    width: 4px;
    height: 18px;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    text-align: left;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0.08;
    border-radius: 50%;
    transform: translate(40px, -40px);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
    position: relative;
    z-index: 1;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    position: relative;
    z-index: 1;
}

.stat-card .label {
    color: var(--gray-500);
    font-size: 12px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.stat-card.success .stat-icon { background: linear-gradient(135deg, var(--success), #38a169); box-shadow: 0 4px 10px rgba(72, 187, 120, 0.3); }
.stat-card.danger .stat-icon { background: linear-gradient(135deg, var(--danger), #e53e3e); box-shadow: 0 4px 10px rgba(245, 101, 101, 0.3); }
.stat-card.warning .stat-icon { background: linear-gradient(135deg, var(--warning), #dd6b20); box-shadow: 0 4px 10px rgba(237, 137, 54, 0.3); }
.stat-card.info .stat-icon { background: linear-gradient(135deg, var(--info), #3182ce); box-shadow: 0 4px 10px rgba(66, 153, 225, 0.3); }

/* ===== Form ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.3s;
    background: #fff;
    font-family: inherit;
    color: var(--gray-900);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

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' viewBox='0 0 24 24' fill='none' stroke='%23718096' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 38px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    gap: 6px;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-dark));
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-dark));
    color: #fff;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-dark));
    color: #fff;
}

.btn-info {
    background: linear-gradient(135deg, var(--info), var(--info-dark));
    color: #fff;
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== Table ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

table th,
table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    vertical-align: middle;
}

table th {
    background: linear-gradient(180deg, var(--gray-50), #fff);
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover {
    background: var(--gray-50);
}

table .actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

table tbody tr {
    transition: all 0.2s;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid;
    font-weight: 500;
    animation: slideInDown 0.4s ease;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert::before {
    font-size: 18px;
    font-weight: bold;
}

.alert-success {
    background: #f0fff4;
    color: #22543d;
    border-left-color: var(--success);
}

.alert-success::before { content: '\2713'; }

.alert-danger {
    background: #fff5f5;
    color: #742a2a;
    border-left-color: var(--danger);
}

.alert-danger::before { content: '\2715'; }

.alert-info {
    background: #ebf8ff;
    color: #2a4365;
    border-left-color: var(--info);
}

.alert-info::before { content: 'i'; font-style: italic; }

.alert-warning {
    background: #fffaf0;
    color: #744210;
    border-left-color: var(--warning);
}

.alert-warning::before { content: '!'; }

/* ===== Badge ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #c6f6d5;
    color: #22543d;
    box-shadow: 0 0 0 1px rgba(72, 187, 120, 0.2);
}

.badge-danger {
    background: #fed7d7;
    color: #742a2a;
    box-shadow: 0 0 0 1px rgba(245, 101, 101, 0.2);
}

.badge-info {
    background: #bee3f8;
    color: #2a4365;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(4px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideInUp 0.3s;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 22px;
}

.modal-footer {
    padding: 15px 22px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--gray-50);
    border-radius: 0 0 12px 12px;
}

/* ===== Profile ===== */
.profile-card {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(102,126,234,0.05), rgba(118,75,162,0.05));
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 700;
    margin: 0 auto 15px;
    box-shadow: 0 8px 20px rgba(102,126,234,0.3);
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--gray-900);
}

.profile-info {
    color: var(--gray-500);
    font-size: 14px;
}

.profile-details .detail-row {
    display: flex;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    transition: background 0.2s;
}

.profile-details .detail-row:hover {
    background: var(--gray-50);
}

.profile-details .detail-row:last-child {
    border-bottom: none;
}

.profile-details .detail-label {
    font-weight: 600;
    width: 45%;
    color: var(--gray-700);
}

.profile-details .detail-value {
    width: 55%;
    color: var(--gray-900);
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state .icon {
    font-size: 50px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }
    .sidebar .sidebar-header h3,
    .sidebar .sidebar-header p,
    .sidebar-menu li a span:not(.icon) {
        display: none;
    }
    .sidebar-header .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .main-content {
        margin-left: 70px;
        padding: 15px;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .page-header h2 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stat-card .number {
        font-size: 26px;
    }
    .login-box {
        padding: 30px 25px;
    }
}
