@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Clean Light Theme Color Palette */
    --bg-primary: #f8fafc; /* Slate 50 */
    --bg-surface: #ffffff; /* Pure White */
    --bg-card: #ffffff;
    --bg-hover: #f1f5f9; /* Slate 100 */
    --border-color: #e2e8f0; /* Slate 200 */
    --border-focus: #3b82f6; /* Blue 500 */

    --text-primary: #0f172a; /* Slate 900 */
    --text-secondary: #475569; /* Slate 600 */
    --text-muted: #94a3b8; /* Slate 400 */

    --accent: #2563eb; /* Blue 600 */
    --accent-hover: #1d4ed8; /* Blue 700 */
    --accent-light: #eff6ff; /* Blue 50 */
    --accent-glow: rgba(37, 99, 235, 0.15);

    --success: #059669;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #d97706;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;

    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;

    /* Priority Badges (Light mode optimized) */
    --kritis: #b91c1c;
    --kritis-bg: #fee2e2;
    --kritis-border: #fca5a5;

    --urgent: #c2410c;
    --urgent-bg: #ffedd5;
    --urgent-border: #fdba74;

    --penting: #b45309;
    --penting-bg: #fef3c7;
    --penting-border: #fcd34d;

    --biasa: #047857;
    --biasa-bg: #d1fae5;
    --biasa-border: #6ee7b7;

    /* Elevations & Radii */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Base Layout (Mobile First) */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Mobile Navbar */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--shadow-sm);
}

.mobile-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 1.25rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 45;
}

.mobile-sidebar-overlay.active {
    display: block;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: fixed;
    top: 0;
    left: -280px; /* Hidden on mobile by default */
    height: 100vh;
    z-index: 50;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: var(--shadow-md);
}

.sidebar.open {
    left: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-badge {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.nav-section {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    margin: 14px 0 6px 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    margin-bottom: 3px;
    font-weight: 500;
    font-size: 0.875rem;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    border-left: 3px solid var(--accent);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Main Content Area */
.main-content {
    flex: 1;
    padding: 20px 16px;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
}

/* Responsive Desktop Media Query */
@media (min-width: 1024px) {
    .app-container {
        flex-direction: row;
    }

    .mobile-header {
        display: none;
    }

    .sidebar {
        left: 0;
        position: fixed;
        width: 260px;
    }

    .main-content {
        margin-left: 260px;
        padding: 28px 36px;
    }

    .page-title {
        font-size: 1.75rem;
    }
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Grid Layouts (Mobile First) */
.grid {
    display: grid;
    gap: 16px;
}

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

@media (min-width: 640px) {
    .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Stat Cards */
.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    margin-top: 2px;
    line-height: 1.1;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    border: none;
    outline: none;
    touch-action: manipulation;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 0.775rem;
    border-radius: var(--radius-sm);
}

/* Badges & Pills */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-kritis { background: var(--kritis-bg); color: var(--kritis); border: 1px solid var(--kritis-border); }
.badge-urgent { background: var(--urgent-bg); color: var(--urgent); border: 1px solid var(--urgent-border); }
.badge-penting { background: var(--penting-bg); color: var(--penting); border: 1px solid var(--penting-border); }
.badge-biasa { background: var(--biasa-bg); color: var(--biasa); border: 1px solid var(--biasa-border); }

.badge-selesai { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-proses { background: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.badge-draft { background: #f1f5f9; color: var(--text-secondary); border: 1px solid #cbd5e1; }
.badge-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }

/* Tables (Mobile Optimized) */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
    background: var(--bg-surface);
}

th {
    padding: 12px 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

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

tr:hover td {
    background: #f8fafc;
}

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

textarea.form-control {
    min-height: 90px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid var(--success-border);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

/* Filter Toolbar */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

@media (min-width: 768px) {
    .filter-group {
        width: auto;
    }
}

/* Progress bar */
.progress-bar-container {
    width: 100%;
    background: #e2e8f0;
    height: 7px;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #10b981);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* Rich Text Editor (Quill.js) Custom Styling */
.ql-toolbar.ql-snow {
    border-color: var(--border-color) !important;
    background: #f8fafc;
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
    padding: 6px 8px !important;
}
.ql-container.ql-snow {
    border-color: var(--border-color) !important;
    font-family: inherit !important;
    font-size: 0.9rem !important;
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    background: #ffffff;
}
.ql-editor {
    min-height: 110px;
    line-height: 1.6;
    padding: 12px 14px !important;
}
.ql-editor.ql-blank::before {
    color: var(--text-muted) !important;
    font-style: normal !important;
    font-size: 0.875rem;
}

/* Rich Text Output Formatting for Web Views */
.rich-text-content {
    line-height: 1.65;
    color: var(--text-primary);
    font-size: 0.925rem;
}
.rich-text-content p {
    margin-bottom: 0.5rem;
}
.rich-text-content p:last-child {
    margin-bottom: 0;
}
.rich-text-content ol {
    list-style-type: decimal;
    padding-left: 1.35rem;
    margin: 0.4rem 0 0.6rem 0;
}
.rich-text-content ul {
    list-style-type: disc;
    padding-left: 1.35rem;
    margin: 0.4rem 0 0.6rem 0;
}
.rich-text-content li {
    margin-bottom: 0.25rem;
}
.rich-text-content strong {
    font-weight: 700;
}

/* Pagination Modern Clean Styling */
nav[role="navigation"] {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px 4px 4px;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

nav[role="navigation"] svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
}

nav[role="navigation"] a,
nav[role="navigation"] span[aria-current="page"] span,
nav[role="navigation"] span[aria-disabled="true"] span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
    font-size: 0.825rem;
    min-width: 32px;
    height: 32px;
}

nav[role="navigation"] a:hover {
    background: var(--bg-hover);
    border-color: #cbd5e1;
    color: var(--accent);
}

nav[role="navigation"] span[aria-current="page"] span {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

nav[role="navigation"] span[aria-disabled="true"] span {
    color: var(--text-muted);
    background: #f8fafc;
    cursor: not-allowed;
}

nav[role="navigation"] > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

nav[role="navigation"] > div:last-child {
    display: flex;
    align-items: center;
    gap: 4px;
}


