/* ============================================
   Knowledge Management SMA 50 Jakarta
   Custom Stylesheet
   ============================================ */

:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --secondary: #6b7280;
    --accent: #f59e0b;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #1a56db;
    --sidebar-text: #cbd5e1;
    --sidebar-width: 260px;
    --header-height: 60px;
    --body-bg: #f1f5f9;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    overflow-x: hidden;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    overflow: hidden;
    max-width: 420px;
    width: 100%;
}

.login-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.login-header .school-logo {
    width: 70px;
    height: 70px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 28px;
}

.login-header h4 {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.login-header p {
    font-size: 0.85rem;
    opacity: 0.85;
}

.login-body {
    padding: 30px;
}

.login-body .form-control {
    border-radius: 8px;
    padding: 10px 15px;
    border: 1.5px solid #e2e8f0;
    font-size: 0.9rem;
}

.login-body .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.15);
}

.login-body .btn-login {
    background: linear-gradient(135deg, #1a56db,#1e40af);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    width: 100%;
    transition: all .3s;
}

.login-body .btn-login:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1e3a5f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(26,86,219,0.4);
}

.login-body .input-group-text {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--secondary);
}

.login-body .input-group .form-control {
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1050;
    transition: transform .3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 22px;
    color: #fff;
}

.sidebar-brand h5 {
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.sidebar-brand small {
    color: var(--sidebar-text);
    font-size: 0.72rem;
}

.sidebar-menu {
    padding: 15px 0;
    flex: 1;
    overflow-y: auto;
}

.sidebar-menu .menu-label {
    padding: 8px 20px 6px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #64748b;
    font-weight: 600;
}

.sidebar-menu .menu-item {
    display: block;
    padding: 10px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all .2s;
    border-left: 3px solid transparent;
}

.sidebar-menu .menu-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu .menu-item.active {
    background: rgba(26,86,219,0.15);
    color: #60a5fa;
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-menu .menu-item i {
    width: 22px;
    margin-right: 10px;
    text-align: center;
    font-size: 1rem;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin .3s ease;
}

/* ---- Top Header ---- */
.top-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-header .toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--secondary);
    cursor: pointer;
    display: none;
}

.top-header .user-dropdown .btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #334155;
}

.top-header .user-dropdown .btn:hover {
    background: #f8fafc;
}

.top-header .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.page-title {
    font-size: 0.9rem;
    color: #64748b;
}

.page-title strong {
    color: #1e293b;
}

/* ---- Content Area ---- */
.content-area {
    padding: 25px;
}

/* ---- Cards ---- */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px;
    border: 1px solid #e2e8f0;
    transition: all .3s;
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-icon.bg-blue { background: #dbeafe; color: #2563eb; }
.stat-card .stat-icon.bg-green { background: #dcfce7; color: #16a34a; }
.stat-card .stat-icon.bg-yellow { background: #fef3c7; color: #d97706; }
.stat-card .stat-icon.bg-purple { background: #ede9fe; color: #7c3aed; }
.stat-card .stat-icon.bg-red { background: #fee2e2; color: #dc2626; }
.stat-card .stat-icon.bg-cyan { background: #cffafe; color: #0891b2; }

.stat-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 12px 0 4px;
}

.stat-card p {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0;
}

/* ---- Table Styling ---- */
.table-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.table-card .table {
    margin: 0;
    font-size: 0.87rem;
}

.table-card .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
}

.table-card .table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.table-card .table tbody tr:hover {
    background: #f8fafc;
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 8px 16px;
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-action {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.8rem;
    border: none;
}

/* ---- Form Styling ---- */
.form-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
}

.form-card .form-label {
    font-weight: 600;
    font-size: 0.82rem;
    color: #475569;
    margin-bottom: 5px;
}

.form-card .form-control,
.form-card .form-select {
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    padding: 9px 14px;
    font-size: 0.88rem;
}

.form-card .form-control:focus,
.form-card .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}

/* ---- Announcement Card ---- */
.announcement-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    margin-bottom: 15px;
    transition: all .3s;
}

.announcement-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.announcement-card .ann-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    font-size: 1rem;
}

.announcement-card .ann-meta {
    font-size: 0.78rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.announcement-card .ann-content {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.6;
}

/* ---- Folder & Document Cards ---- */
.folder-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 20px;
    text-align: center;
    transition: all .3s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
    height: 100%;
}

.folder-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px);
    color: inherit;
}

.folder-card .folder-icon {
    font-size: 2.5rem;
    color: #f59e0b;
    margin-bottom: 10px;
}

.folder-card .folder-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    margin-bottom: 4px;
}

.folder-card .folder-count {
    font-size: 0.75rem;
    color: #94a3b8;
}

.doc-item {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 14px 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all .2s;
}

.doc-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.doc-item .doc-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.doc-item .doc-info {
    flex: 1;
    min-width: 0;
}

.doc-item .doc-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-item .doc-meta {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ---- Profile ---- */
.profile-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #1a56db 100%);
    padding: 30px;
    text-align: center;
    color: #fff;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 2rem;
    font-weight: 700;
    border: 3px solid rgba(255,255,255,0.4);
}

.profile-body {
    padding: 24px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h5 {
    color: #64748b;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ---- Footer ---- */
.main-footer {
    padding: 20px 25px;
    text-align: center;
    font-size: 0.78rem;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    margin-top: 30px;
}

/* ---- Overlay ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1045;
}

/* ---- Alert ---- */
.alert {
    border-radius: 10px;
    font-size: 0.88rem;
    border: none;
}

/* ---- Pagination ---- */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    font-size: 0.85rem;
    color: var(--primary);
    border: 1px solid #e2e8f0;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* ---- Scrollbar ---- */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 10px;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

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

    .main-content {
        margin-left: 0;
    }

    .top-header .toggle-sidebar {
        display: block;
    }
}

@media (max-width: 576px) {
    .content-area {
        padding: 15px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card h3 {
        font-size: 1.2rem;
    }
}
