* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    color: #1f2937;
}

a {
    text-decoration: none;
}

.app-page {
    min-height: 100vh;
    background:
        linear-gradient(135deg, rgba(3, 59, 31, 0.90), rgba(22, 163, 74, 0.70), rgba(240, 253, 244, 0.92)),
        url('../img/bg-kantor-camat.jpg') center center / cover fixed no-repeat;
    position: relative;
}

.app-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(187, 247, 208, 0.28), transparent 35%),
        radial-gradient(circle at bottom right, rgba(20, 83, 45, 0.24), transparent 38%);
    pointer-events: none;
    z-index: 0;
}

.sidebar,
.main-content,
.sidebar-toggle,
.floating-notification {
    position: relative;
    z-index: 2;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 275px;
    height: 100vh;
    background: rgba(5, 46, 22, 0.90);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #fff;
    padding: 22px 16px;
    z-index: 1200;
    box-shadow: 12px 0 34px rgba(0, 0, 0, 0.22);
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    transition: all 0.32s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.sidebar-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    background: rgba(255,255,255,0.13);
    border-radius: 16px;
    padding: 7px;
    flex-shrink: 0;
}

.sidebar-brand strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    line-height: 1.3;
}

.sidebar-brand span {
    font-size: 12px;
    opacity: 0.88;
    line-height: 1.4;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-menu-main {
    flex: 1;
}

.sidebar-menu-bottom {
    padding-top: 16px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.16);
}

.sidebar-menu a {
    color: #ffffff;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.1px;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.14);
    transform: translateX(4px);
}

.sidebar-menu a.active {
    background: rgba(220, 252, 231, 0.20);
    border: 1px solid rgba(220, 252, 231, 0.32);
    color: #dcfce7;
    font-weight: bold;
}

/* TOMBOL SIDEBAR */
.sidebar-toggle {
    position: fixed;
    top: 18px;
    left: 292px;
    z-index: 1500;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 15px;
    background: rgba(5, 46, 22, 0.90);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: white;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0,0,0,0.26);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.28s ease;
}

.sidebar-toggle:hover {
    background: rgba(22, 101, 52, 0.98);
    transform: translateY(-2px) scale(1.04);
}

.toggle-icon {
    width: 22px;
    height: 18px;
    position: relative;
    display: inline-block;
}

.toggle-icon span {
    position: absolute;
    left: 0;
    width: 22px;
    height: 2.5px;
    border-radius: 999px;
    background: white;
    transition: all 0.28s ease;
}

.toggle-icon span:nth-child(1) {
    top: 0;
}

.toggle-icon span:nth-child(2) {
    top: 7.5px;
}

.toggle-icon span:nth-child(3) {
    top: 15px;
}

.sidebar-toggle.is-active .toggle-icon span:nth-child(1) {
    top: 7.5px;
    transform: rotate(45deg);
}

.sidebar-toggle.is-active .toggle-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
}

.sidebar-toggle.is-active .toggle-icon span:nth-child(3) {
    top: 7.5px;
    transform: rotate(-45deg);
}

/* CONTENT */
.main-content {
    margin-left: 275px;
    min-height: 100vh;
    padding: 28px;
    transition: all 0.32s ease;
}

.content-glass {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 26px;
    padding: 24px;
    min-height: calc(100vh - 56px);
    box-shadow: 0 18px 44px rgba(0,0,0,0.12);
}

.page-header {
    background: linear-gradient(135deg, rgba(20, 83, 45, 0.96), rgba(34, 197, 94, 0.94));
    color: white;
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: 0 16px 35px rgba(22, 101, 52, 0.22);
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -60px;
    top: -90px;
    border-radius: 50%;
    background: rgba(255,255,255,0.13);
}

.page-header h1,
.page-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    position: relative;
    z-index: 2;
}

.page-header p {
    font-size: 14px;
    line-height: 1.7;
    opacity: 0.96;
    position: relative;
    z-index: 2;
}

.card-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 24px 22px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.09);
    border-left: 6px solid #16a34a;
    transition: all 0.25s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    font-size: 34px;
    color: #14532d;
    margin-bottom: 10px;
}

.card p {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

.form-box,
.filter-box,
.table-box,
.info-box,
.preview-box {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.09);
    margin-bottom: 22px;
}

h2 {
    color: #14532d;
    margin-bottom: 16px;
    font-size: 28px;
}

h3 {
    color: #166534;
    margin-bottom: 14px;
}

p {
    line-height: 1.7;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #14532d;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
}

.btn {
    display: inline-block;
    background: #166534;
    color: white;
    padding: 10px 16px;
    border-radius: 11px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-right: 8px;
    margin-bottom: 8px;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn-success {
    background: #16a34a;
}

.btn-warning {
    background: #f59e0b;
}

.btn-danger {
    background: #dc2626;
}

.btn-info {
    background: #0284c7;
}

.file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.94);
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.09);
}

table th {
    background: #166534;
    color: white;
    padding: 14px 12px;
    text-align: left;
    font-size: 14px;
}

table td {
    padding: 13px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    vertical-align: top;
}

table tr:hover td {
    background: #f8fafc;
}

.alert {
    padding: 14px 16px;
    border-radius: 13px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.6;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.status {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.status-dikirim {
    background: #0ea5e9;
}

.status-diproses {
    background: #f59e0b;
}

.status-perlu-revisi {
    background: #dc2626;
}

.status-diterima {
    background: #16a34a;
}

.status-ditolak {
    background: #6b7280;
}

.notif-row-unread td {
    background: #f0fdf4 !important;
    font-weight: 600;
}

.floating-notification {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(5, 46, 22, 0.94);
    color: white;
    padding: 16px 20px;
    border-radius: 999px;
    box-shadow: 0 16px 34px rgba(0,0,0,0.30);
    font-weight: bold;
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.28s ease;
}

.floating-notification:hover {
    background: rgba(22, 101, 52, 0.98);
    transform: translateY(-3px) scale(1.03);
}

.floating-icon {
    font-size: 22px;
}

.floating-text {
    font-size: 15px;
}

.floating-helper {
    display: block;
    font-size: 11px;
    font-weight: normal;
    opacity: 0.88;
    margin-top: 2px;
}

.floating-badge {
    position: absolute;
    top: -9px;
    right: -8px;
    min-width: 25px;
    height: 25px;
    padding: 0 7px;
    border-radius: 999px;
    background: #dc2626;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid white;
}

.preview-box iframe {
    width: 100%;
    height: 650px;
    border: none;
    border-radius: 16px;
    background: white;
}

.preview-unavailable {
    padding: 18px;
    border-radius: 14px;
    background: #fef3c7;
    color: #92400e;
    line-height: 1.6;
}

.pagination-wrapper {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.pagination-wrapper nav {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pagination-wrapper a,
.pagination-wrapper span {
    padding: 8px 12px;
    border-radius: 10px;
    background: white;
    color: #14532d;
    border: 1px solid #d1fae5;
    font-size: 13px;
}

.mt-2 {
    margin-top: 18px;
}

.mb-2 {
    margin-bottom: 18px;
}

.print-header {
    display: none;
}

/* STATE SIDEBAR */
body.sidebar-collapsed .sidebar {
    left: -295px;
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

body.sidebar-collapsed .sidebar-toggle {
    left: 18px;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .sidebar {
        left: -295px;
    }

    .main-content {
        margin-left: 0;
        padding: 22px 16px 100px;
    }

    .content-glass {
        padding: 18px;
    }

    .sidebar-toggle {
        left: 18px;
    }

    body.sidebar-open .sidebar {
        left: 0;
    }

    body.sidebar-open .sidebar-toggle {
        left: 292px;
    }
}

@media (max-width: 576px) {
    .page-header h1,
    .page-header h2 {
        font-size: 23px;
    }

    body.sidebar-open .sidebar-toggle {
        left: 232px;
    }

    .sidebar {
        width: 215px;
    }

    .floating-notification {
        right: 18px;
        bottom: 18px;
        padding: 14px 16px;
    }

    .floating-text {
        font-size: 13px;
    }

    .preview-box iframe {
        height: 450px;
    }
}

/* PRINT */
@media print {
    .sidebar,
    .sidebar-toggle,
    .floating-notification,
    .btn,
    .filter-box,
    .preview-box {
        display: none !important;
    }

    .app-page {
        background: white !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .content-glass {
        box-shadow: none !important;
        background: white !important;
        padding: 0 !important;
    }

    .print-header {
        display: block;
        text-align: center;
        margin-bottom: 20px;
    }

    .print-header img {
        width: 70px;
        height: 70px;
        object-fit: contain;
        margin-bottom: 8px;
    }

    .print-header h2,
    .print-header h3,
    .print-header p {
        color: #000 !important;
        margin: 0;
    }

    .print-header hr {
        margin-top: 10px;
        border: 1px solid #000;
    }

    table {
        box-shadow: none;
        border-radius: 0;
    }

    table th {
        background: #e5e7eb !important;
        color: #000 !important;
    }
}

.quick-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.quick-card h3 {
    font-size: 28px;
    margin-bottom: 8px;
}

.quick-card:hover {
    transform: translateY(-3px);
    transition: 0.2s ease;
}

