/* =======================================================
   1. IMPORT & SETUP
   ======================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* CSS Variables untuk Tema */
:root {
    --primary-color: #4a69bd;
    --primary-hover: #3c5aa6;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f5f6fa;
    --white: #ffffff;
    --text-color: #2c3e50;
    --text-muted: #7f8c8d;
    --border-color: #dcdde1;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
    --font-family: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =======================================================
   2. GLOBAL STYLES
   ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px 0;
}

/* =======================================================
   3. LAYOUT
   ======================================================= */
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-header {
    text-align: center;
    color: var(--white);
    margin-bottom: 40px;
}

.app-header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 2px 4px 6px rgba(0,0,0,0.2);
}

/* =======================================================
   4. COMPONENTS
   ======================================================= */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    overflow: hidden;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--white);
    padding: 20px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.card-body {
    padding: 30px;
}

/* --- Form --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
    background-color: var(--light-bg);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(74, 105, 189, 0.2);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary { background: var(--primary-color); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-success { background: var(--success-color); color: var(--white); }
.btn-warning { background: var(--warning-color); color: var(--white); }
.btn-danger { background: var(--danger-color); color: var(--white); }

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* --- Table --- */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background-color: var(--light-bg);
}

.table th, .table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-color);
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(74, 105, 189, 0.05);
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* --- Alert --- */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 500;
    animation: slideIn 0.4s ease-out;
}
.alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* =======================================================
   5. PRINT STYLES (DESAIN ULANG TOTAL)
   ======================================================= */
@media print {
    body {
        background: none;
        font-family: 'Times New Roman', Times, serif;
        font-size: 12pt;
        line-height: 1.5;
        color: black;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }
    
    .app-container, .card {
        box-shadow: none;
        margin: 0;
        padding: 0;
        border: none;
        background: none;
    }

    @page {
        size: A4;
        margin: 1.5cm;
    }

    .print-document {
        border: 1px solid #333;
        padding: 30px;
        width: 100%;
    }

    .print-header {
        text-align: center;
        margin-bottom: 30px;
        border-bottom: 1px solid #ccc;
        padding-bottom: 15px;
    }

    .print-logo {
        max-width: 120px;
        margin-bottom: 10px;
    }

    .print-header h1 {
        font-size: 18pt;
        font-weight: bold;
        margin: 0;
        color: black;
    }

    .print-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px 20px;
    }

    .print-field {
        display: flex;
    }

    .print-field-label {
        font-weight: bold;
        min-width: 150px;
        margin-right: 10px;
    }

    .print-field-value {
        flex-grow: 1;
    }
}

/* =======================================================
   6. RESPONSIVE
   ======================================================= */
@media (max-width: 768px) {
    body { padding: 10px 0; }
    .app-header h1 { font-size: 2.2rem; }
    .card-body { padding: 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .btn-group { flex-direction: column; }
    .table-actions { flex-direction: column; }
}