/*
Theme Name: Indo AHU Legal Decree Theme
Theme URI: https://github.com/indo-visa/indo-ahu-theme
Author: Indo Visa Solutions
Author URI: https://indo-visa.com/
Description: Complete Indonesian Ministry of Law (AHU) Legal Decree & PT/PMA Management WordPress Theme. Features full-featured WordPress admin dashboard form filling with dynamic shareholders, auto-generated zero-border QR code verification, 1:1 exact official 1-page decree PDF export (F4/Folio), and mobile-first official AHU verification landing pages.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: indo-ahu-theme
Tags: government, decree, legal, pdf-generator, ahu-online, responsive-layout
*/

/* ==========================================================================
   1. RESET & BASE TYPOGRAPHY
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body:not(.wp-admin) {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #0f172a;
    color: #334155;
    line-height: 1.5;
    min-height: 100vh;
}

.ahu-admin-wrap {
    max-width: 1400px;
    margin: 15px 20px 20px 0;
}
.ahu-admin-wrap .ahu-container {
    padding: 10px 0;
}

/* ==========================================================================
   2. DASHBOARD & INTERFACE LAYOUT
   ========================================================================== */
.ahu-theme-header {
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
}
.ahu-theme-title h1 {
    font-size: 19px;
    font-weight: 700;
    color: #f8fafc;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ahu-theme-title p {
    font-size: 12.5px;
    color: #94a3b8;
    margin-top: 2px;
}
.ahu-theme-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ahu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}
.ahu-btn-primary { background: #2563eb; color: #ffffff; }
.ahu-btn-primary:hover { background: #1d4ed8; }
.ahu-btn-success { background: #059669; color: #ffffff; }
.ahu-btn-success:hover { background: #047857; }
.ahu-btn-dark { background: #334155; color: #f8fafc; }
.ahu-btn-dark:hover { background: #475569; }
.ahu-btn-danger { background: #dc2626; color: #ffffff; }
.ahu-btn-danger:hover { background: #b91c1c; }
.ahu-btn-sm { padding: 4px 10px; font-size: 12px; }

.ahu-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Nav Tabs */
.ahu-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #334155;
    margin-bottom: 24px;
}
.ahu-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
}
.ahu-tab-btn:hover { color: #f8fafc; }
.ahu-tab-btn.active {
    color: #38bdf8;
    border-bottom-color: #38bdf8;
}

/* View Sections */
.ahu-view-section { display: none; }
.ahu-view-section.active { display: block; }

/* Dashboard Cards & Table */
.ahu-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.ahu-panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ahu-panel-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.ahu-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}
.ahu-data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    padding: 12px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.ahu-data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}
.ahu-data-table tr:hover td { background: #f8fafc; }

/* Form Layout */
.ahu-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}
.ahu-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ahu-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.ahu-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s ease;
}
.ahu-input:focus { border-color: #2563eb; ring: 2px solid #93c5fd; }
.ahu-section-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin: 20px 0 14px;
}

/* ==========================================================================
   3. EXACT 1:1 OFFICIAL DECREE LAYOUT (INDONESIAN FOLIO / F4: 215mm x 330mm)
   ========================================================================== */
@page {
    size: 215mm 330mm;
    margin: 0;
}

.pdf-preview-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #f8fafc;
}
.pdf-scroll-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 30px 10px 60px;
    background: #334155;
}

.ahu-sheet {
    width: 215mm;
    height: 330mm;
    min-height: 330mm;
    position: relative;
    background-color: #ffffff;
    background-image: url('assets/images/border-bg-official.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    overflow: hidden;
    color: #000000;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    page-break-after: always;
}

/* Authentic Decree Border Frame */
.ahu-sheet::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 215mm;
    height: 330mm;
    background-image: url('assets/images/border-bg-official.png');
    background-size: 215mm 330mm;
    background-repeat: no-repeat;
    background-position: top left;
    pointer-events: none;
    z-index: 1;
}

/* Authentic Garuda Center Watermark */
.ahu-sheet::after {
    content: "";
    position: absolute;
    top: 105mm;
    left: 27.5mm;
    width: 160mm;
    height: 160mm;
    background-image: url('assets/images/watermark.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.08;
    pointer-events: none;
    z-index: 2;
}

.bold { font-weight: bold; }

/* Top Pengayoman Official Logo */
.ahu-logo-wrap {
    position: absolute;
    top: 19.50mm;
    left: 96.50mm;
    width: 22.00mm;
    height: 23.50mm;
    text-align: center;
    z-index: 10;
}
.ahu-logo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Header Titles */
.ahu-header-titles {
    position: absolute;
    top: 48.00mm;
    left: 23.52mm;
    right: 23.52mm;
    text-align: center;
    line-height: 4.816mm;
    font-size: 9.75pt;
    z-index: 10;
}
.ahu-h-line {
    letter-spacing: 0.15px;
    text-transform: uppercase;
}

/* Page 1 Consideration Rows (Menimbang / Mengingat) */
.ahu-p1-content {
    position: absolute;
    top: 83.50mm;
    left: 23.52mm;
    right: 23.52mm;
    line-height: 4.816mm;
    font-size: 9.75pt;
    z-index: 10;
}
.ahu-row-consider {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2.20mm;
}
.ahu-col-title { width: 33.50mm; font-weight: bold; flex-shrink: 0; }
.ahu-col-colon { width: 4.00mm; text-align: center; flex-shrink: 0; }
.ahu-col-bullet { width: 4.50mm; flex-shrink: 0; }
.ahu-col-text { flex-grow: 1; text-align: justify; text-justify: inter-word; }

.ahu-memutuskan {
    text-align: center;
    font-weight: bold;
    letter-spacing: 1.5px;
    margin: 3.50mm 0 3.00mm;
}

/* Page 1 & Page 2 Signature Block */
.ahu-sig-block-p1 {
    position: absolute;
    top: 228.00mm;
    left: 23.52mm;
    right: 23.52mm;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}
.ahu-sig-block-p2 {
    position: absolute;
    top: 148.00mm;
    left: 23.52mm;
    right: 23.52mm;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}
.ahu-qr-col { width: 42.33mm; height: 42.33mm; }
.ahu-qr-box { width: 42.33mm; height: 42.33mm; }
.ahu-qr-box svg { width: 100%; height: 100%; display: block; }

.ahu-officer-col {
    width: 95.00mm;
    font-size: 9.75pt;
    line-height: 4.816mm;
    text-align: left;
}
.ahu-ditetapkan { margin-bottom: 1.50mm; }
.ahu-an-menteri { text-transform: uppercase; font-weight: bold; }
.ahu-signature-wrap {
    height: 18.00mm;
    margin: 1.00mm 0 2.00mm 12.00mm;
}
.ahu-signature-wrap img {
    height: 100%;
    object-fit: contain;
}
.ahu-official-name {
    margin-left: 20.00mm;
    font-size: 9.75pt;
    font-weight: bold;
}

/* Footers */
.ahu-footer-p1 {
    position: absolute;
    top: 280.00mm;
    left: 23.52mm;
    right: 23.52mm;
    font-size: 9.75pt;
    line-height: 4.816mm;
    z-index: 10;
}
.ahu-footer-p2 {
    position: absolute;
    top: 191.05mm;
    left: 23.52mm;
    right: 23.52mm;
    font-size: 9.75pt;
    line-height: 4.816mm;
    z-index: 10;
}

/* Page 2 Specifics */
.ahu-lampiran-info {
    position: absolute;
    top: 84.00mm;
    left: 23.52mm;
    right: 23.52mm;
    line-height: 4.816mm;
    font-size: 9.75pt;
    z-index: 10;
}
.ahu-lampiran-info div { margin-bottom: 0.80mm; }

/* Calibrated Table: 5.50px positive clearance below item 3 */
.ahu-table {
    position: absolute;
    top: 101.50mm;
    left: 23.52mm;
    width: 167.96mm;
    border-collapse: collapse;
    font-size: 9.75pt;
    table-layout: fixed;
    z-index: 10;
}
.ahu-table th {
    height: 10.32mm;
    background-color: #000000;
    color: #ffffff;
    border: 0.5pt solid #555555;
    padding: 2px 4px;
    font-weight: bold;
    text-align: center;
    vertical-align: middle;
    line-height: 11pt;
}
.ahu-table td {
    height: 5.77mm;
    border: 0.5pt solid #666666;
    padding: 1.5px 4px;
    vertical-align: middle;
    line-height: 13.65pt;
    white-space: nowrap !important;
    overflow: hidden;
}
.ahu-table tr:nth-child(even) td { background-color: #f2f2f2; }

.ahu-col-th-nama { width: 28%; text-align: left; padding-left: 6px; }
.ahu-col-th-jabatan { width: 23%; text-align: left; padding-left: 6px; }
.ahu-col-th-klasifikasi { width: 10%; text-align: center; }
.ahu-col-th-lembar { width: 14%; text-align: right; padding-right: 6px; }
.ahu-col-th-total { width: 25%; text-align: right; padding-right: 6px; }
.ahu-text-left { text-align: left; padding-left: 6px; }
.ahu-text-center { text-align: center; }
.ahu-text-right { text-align: right; padding-right: 6px; }

/* Print Media Override */
@media print {
    body { background: none !important; }
    .ahu-theme-header, .ahu-nav-tabs, .pdf-preview-bar, .ahu-theme-footer { display: none !important; }
    .pdf-scroll-stage { padding: 0 !important; background: none !important; }
    .ahu-sheet {
        margin: 0 !important;
        box-shadow: none !important;
        page-break-after: always !important;
        page-break-inside: avoid !important;
    }
}

/* ==========================================================================
   4. OFFICIAL AHU VERIFICATION LANDING PAGE (MOBILE & DESKTOP)
   ========================================================================== */
.ahu-val-page {
    background-color: #f1f4f8;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.ahu-val-top-bar {
    background-color: #11141a;
    color: #ffffff;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ahu-val-top-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}
.ahu-val-top-title-main {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.25;
    text-transform: uppercase;
    color: #ffffff;
    font-family: "Georgia", serif, sans-serif;
}
.ahu-val-top-title-sub {
    font-size: 9.5px;
    color: #d1d5db;
    letter-spacing: 0.25px;
    line-height: 1.2;
    margin-top: 1px;
    text-transform: uppercase;
}
.ahu-val-sub-bar {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 7px 14px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.ahu-val-hamburger-box {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 6px 9px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.ahu-val-hamburger-line {
    width: 22px;
    height: 2px;
    background-color: #64748b;
    border-radius: 1px;
}
.ahu-val-wrapper {
    flex: 1;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 14px 20px;
}
.ahu-val-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 2px;
    padding: 24px 18px 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ahu-val-header-title {
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin-bottom: 24px;
    padding: 0 4px;
}
.ahu-val-row { margin-bottom: 16px; }
.ahu-val-label {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-bottom: 3px;
}
.ahu-val-value {
    font-size: 14.5px;
    font-weight: 400;
    color: #374151;
    line-height: 1.35;
    word-break: break-word;
}
.ahu-val-confirm-text {
    margin-top: 24px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}
.ahu-val-url-warning {
    margin-top: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    color: #374151;
}
.ahu-val-url-warning a {
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 500;
}
.ahu-val-footer {
    text-align: center;
    padding: 14px 14px 24px;
    font-size: 12.5px;
    color: #4b5563;
}
