/* =====================================================================
   AQUA GLASS LIGHT THEME
   Konsep: panel kaca bersih di atas background putih/abu terang,
   aksen teal/aqua sebagai signature, teks hitam untuk keterbacaan.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* -- Palette -- */
    --bg-main:       #F0F7F8;       /* background utama: putih kebiruan terang */
    --bg-grad-a:     #E3F4F6;       /* gradient awal */
    --bg-grad-b:     #FFFFFF;       /* gradient akhir */
    --aqua-glow:     #0BA5A0;       /* aksen utama - teal */
    --aqua-light:    #D0F0EF;       /* aksen muda untuk hover/highlight */
    --aqua-dark:     #077A76;       /* aksen gelap untuk hover button */
    --text-primary:  #1A1A1A;       /* teks utama: hitam */
    --text-secondary:#3D3D3D;       /* teks sekunder */
    --text-muted:    #6B7C7D;       /* teks muted: abu kehijauan */
    --danger:        #D93025;
    --danger-bg:     #FEE8E6;
    --success:       #1A7F5A;
    --success-bg:    #E6F4EE;

    /* -- Glass -- */
    --glass-bg:      rgba(255, 255, 255, 0.70);
    --glass-bg-2:    rgba(255, 255, 255, 0.90);
    --glass-border:  rgba(11, 165, 160, 0.20);
    --glass-shadow:  0 4px 24px rgba(11, 165, 160, 0.10);
    --glass-blur:    16px;

    /* -- Type -- */
    --font-display:  'Sora', sans-serif;
    --font-body:     'Inter', sans-serif;
    --font-mono:     'JetBrains Mono', monospace;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: linear-gradient(145deg, var(--bg-grad-a) 0%, var(--bg-grad-b) 60%, #E8F6F7 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0 0 .4em; letter-spacing: .2px; color: var(--text-primary); }
a { color: var(--aqua-glow); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--aqua-dark); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--aqua-glow);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* =====================================================================
   GLASS PANEL
   ===================================================================== */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
}

/* =====================================================================
   BUBBLE BACKGROUND - gelembung aqua transparan di atas background terang
   ===================================================================== */
.bubble-field {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.bubble {
    position: absolute;
    bottom: -10%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(11, 165, 160, 0.12), rgba(11, 165, 160, 0.02));
    border: 1px solid rgba(11, 165, 160, 0.15);
    animation: rise linear infinite;
}
@keyframes rise {
    from { transform: translateY(0) translateX(0); opacity: 0; }
    10%  { opacity: 1; }
    100% { transform: translateY(-115vh) translateX(20px); opacity: 0; }
}

/* =====================================================================
   LOGIN PAGE
   ===================================================================== */
.login-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 44px 38px;
    text-align: center;
    position: relative;
    z-index: 2;
    background: var(--glass-bg-2);
}
.login-card .app-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--aqua-glow);
    margin-bottom: 4px;
    letter-spacing: 2px;
}
.login-card .app-subtitle {
    color: var(--text-muted);
    font-size: .88rem;
    margin-bottom: 28px;
}
.login-card form { text-align: left; }

.login-links {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    font-size: .82rem;
}

.flash-message {
    font-size: .85rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    text-align: left;
}
.flash-message.error   { background: var(--danger-bg);  border: 1px solid rgba(217,48,37,.25); color: var(--danger); }
.flash-message.success { background: var(--success-bg); border: 1px solid rgba(26,127,90,.25); color: var(--success); }

/* =====================================================================
   FORM ELEMENTS
   ===================================================================== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.form-control {
    width: 100%;
    padding: 11px 14px;
    background: #FFFFFF;
    border: 1.5px solid #D4E8E8;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: .92rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control::placeholder { color: #AABFBF; }
.form-control:focus {
    outline: none;
    border-color: var(--aqua-glow);
    box-shadow: 0 0 0 3px rgba(11, 165, 160, 0.12);
}
select.form-control { cursor: pointer; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: .88rem;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .1s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    width: 100%;
    background: var(--aqua-glow);
    color: #FFFFFF;
    border-color: var(--aqua-glow);
    box-shadow: 0 4px 14px rgba(11, 165, 160, 0.25);
}
.btn-primary:hover { background: var(--aqua-dark); border-color: var(--aqua-dark); box-shadow: 0 6px 18px rgba(11, 165, 160, 0.35); }

.btn-secondary {
    background: #FFFFFF;
    border-color: #D4E8E8;
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--aqua-light); border-color: var(--aqua-glow); }

.btn-danger { background: var(--danger-bg); border-color: rgba(217,48,37,.3); color: var(--danger); }
.btn-danger:hover { background: #fdd8d5; }

.btn-sm { padding: 6px 14px; font-size: .78rem; }

/* =====================================================================
   APP SHELL - Sidebar + Header + Content
   ===================================================================== */
.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}
.sidebar {
    width: 240px;
    flex-shrink: 0;
    margin: 14px 0 14px 14px;
    padding: 22px 14px;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg-2);
}
.sidebar .brand {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--aqua-glow);
    margin-bottom: 26px;
    padding-left: 8px;
    letter-spacing: 2px;
}
.nav-group { margin-bottom: 4px; }
.nav-group-label {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--text-muted);
    padding: 12px 8px 4px;
    font-weight: 600;
}
.nav-link {
    display: block;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .88rem;
    margin-bottom: 2px;
    font-weight: 500;
}
.nav-link:hover { background: var(--aqua-light); color: var(--aqua-dark); text-decoration: none; }
.nav-link.active {
    background: var(--aqua-light);
    color: var(--aqua-glow);
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--aqua-glow);
}

.main-area { flex: 1; padding: 14px 20px 20px; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    margin-bottom: 16px;
    background: var(--glass-bg-2);
}
.topbar .page-title {
    font-size: 1.1rem;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
}
.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: var(--text-secondary);
}
.user-chip .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, var(--aqua-glow), var(--aqua-dark));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #FFFFFF; font-family: var(--font-display);
    font-size: .95rem;
}
.content-card { padding: 24px; margin-bottom: 18px; }

/* =====================================================================
   LIST / TABLE
   ===================================================================== */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.search-box { position: relative; max-width: 320px; flex: 1; }
.search-box input {
    width: 100%;
    padding: 9px 14px 9px 34px;
    background: #FFFFFF;
    border: 1.5px solid #D4E8E8;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: .85rem;
}
.search-box input:focus { outline: none; border-color: var(--aqua-glow); box-shadow: 0 0 0 3px rgba(11,165,160,.1); }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .45; font-size: .9rem; }

table.data-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data-table thead th {
    text-align: left;
    padding: 11px 14px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--aqua-light);
    background: #F7FCFC;
}
table.data-table tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid #EBF4F4;
    color: var(--text-primary);
}
table.data-table tbody tr:nth-child(odd)  { background: #FFFFFF; }
table.data-table tbody tr:nth-child(even) { background: #F5FAFA; }
table.data-table tbody tr:hover { background: var(--aqua-light); }
.mono { font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted); }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
}
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-inactive { background: var(--danger-bg);  color: var(--danger); }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    font-size: .82rem;
    color: var(--text-muted);
}
.pagination .pages { display: flex; gap: 4px; }
.pagination .pages button {
    min-width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    border: 1.5px solid #D4E8E8;
    background: #FFFFFF;
    color: var(--text-primary);
    cursor: pointer;
    font-size: .8rem;
    font-weight: 500;
}
.pagination .pages button:hover { background: var(--aqua-light); border-color: var(--aqua-glow); }
.pagination .pages button.active { background: var(--aqua-glow); color: #FFFFFF; border-color: var(--aqua-glow); font-weight: 700; }
.pagination .pages button:disabled { opacity: .35; cursor: not-allowed; }

/* Wave divider */
.wave-divider {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--aqua-glow), transparent);
    opacity: .35;
    border-radius: 999px;
    margin: 0 4px 16px;
}

/* =====================================================================
   PAGE BREADCRUMB
   ===================================================================== */
.page-breadcrumb { margin-bottom: 18px; }
.page-breadcrumb h2 { font-size: 1.2rem; color: var(--text-primary); }
.page-breadcrumb .subtitle { color: var(--text-muted); font-size: .85rem; margin-top: 2px; }

/* =====================================================================
   USER PERMISSION TABLE
   ===================================================================== */
.permission-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    padding: 18px 22px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    background: var(--glass-bg-2);
}
.permission-toolbar .form-group { margin-bottom: 0; min-width: 220px; }

table.permission-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.permission-table thead th {
    text-align: left;
    padding: 11px 14px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--aqua-light);
    background: #F7FCFC;
}
table.permission-table thead th.center,
table.permission-table td.center { text-align: center; }

table.permission-table tr.group-row td {
    padding: 10px 14px 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--aqua-glow);
    background: #EEF9F9;
    border-bottom: 1px solid var(--aqua-light);
}
table.permission-table tbody tr.menu-row td {
    padding: 10px 14px;
    border-bottom: 1px solid #EBF4F4;
    color: var(--text-primary);
}
table.permission-table tbody tr.menu-row:nth-child(odd)  { background: #FFFFFF; }
table.permission-table tbody tr.menu-row:nth-child(even) { background: #F5FAFA; }
table.permission-table tbody tr.menu-row:hover { background: var(--aqua-light); }

/* Custom checkbox bertema aqua light */
.aqua-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid #B0D4D4;
    border-radius: 4px;
    background: #FFFFFF;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    transition: background .12s ease, border-color .12s ease;
}
.aqua-checkbox:hover { border-color: var(--aqua-glow); }
.aqua-checkbox:checked {
    background: var(--aqua-glow);
    border-color: var(--aqua-glow);
}
.aqua-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px; top: 2px;
    width: 5px; height: 9px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.aqua-checkbox:disabled { opacity: .45; cursor: not-allowed; }
.aqua-checkbox.js-all-checkbox:checked { background: var(--aqua-dark); border-color: var(--aqua-dark); }

.save-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 500;
    z-index: 50;
    animation: fadeOut 3s forwards;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.save-toast.success { background: var(--success-bg); border: 1px solid rgba(26,127,90,.3); color: var(--success); }
.save-toast.error   { background: var(--danger-bg);  border: 1px solid rgba(217,48,37,.3); color: var(--danger); }
@keyframes fadeOut { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: auto; margin: 10px; }
}
