/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f1f5f9;
    --white: #FFFFFF;
    --gray-100: #f8fafc;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --header-height: 70px;
    --sidebar-width: 280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 48px;
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-header i {
    font-size: 72px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--gray-500);
    font-size: 15px;
    font-weight: 500;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 500;
}

.login-form label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 15px;
    transition: var(--transition);
    background: var(--gray-100);
    font-weight: 500;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.login-form input::placeholder {
    color: var(--gray-400);
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

.login-info {
    margin-top: 28px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    font-size: 13px;
    color: var(--gray-600);
    border: 1px solid var(--gray-200);
}

.login-info strong {
    color: var(--dark-color);
    font-weight: 700;
}

.login-info code {
    background: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    color: var(--primary-color);
    font-weight: 700;
    border: 1px solid var(--gray-200);
    font-size: 12px;
}

/* Main Application */
.main-app {
    min-height: 100vh;
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: nowrap;
    gap: 20px;
    backdrop-filter: blur(10px);
    overflow-x: auto;
    overflow-y: hidden;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: fit-content;
}

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--white);
}

.logo i {
    font-size: 36px;
    color: #ffd700;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.logo h1 {
    font-size: 26px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Main Navigation */
.main-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
    overflow-x: visible;
}

.main-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 10px;
    transition: var(--transition);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.main-nav .nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.main-nav .nav-item:hover::before {
    transform: translateX(0);
}

.main-nav .nav-item:hover {
    color: var(--white);
    transform: translateY(-2px);
}

.main-nav .nav-item.active {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.main-nav .nav-item i {
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    margin-left: auto;
    min-width: fit-content;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    color: var(--white);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.user-info i {
    font-size: 22px;
    color: #ffd700;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.user-info span {
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.logout-btn {
    background: rgba(239, 68, 68, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 700;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.logout-btn:hover {
    background: var(--danger-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.logout-btn:active {
    transform: translateY(0);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 40px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
}

.stat-card {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    min-height: 120px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--white);
}

.stat-card.blue .stat-icon {
    background: linear-gradient(135deg, #4A90E2, #5DADE2);
}

.stat-card.green .stat-icon {
    background: linear-gradient(135deg, #52C41A, #73D13D);
}

.stat-card.orange .stat-icon {
    background: linear-gradient(135deg, #FAAD14, #FFC53D);
}

.stat-card.purple .stat-icon {
    background: linear-gradient(135deg, #722ED1, #9254DE);
}

.stat-info h3 {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 5px;
}

.stat-info p {
    color: var(--gray-600);
    font-size: 14px;
}

/* Quick Actions */
.quick-actions {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 35px;
}

.quick-actions h2 {
    margin-bottom: 25px;
    color: var(--dark-color);
    font-size: 22px;
    font-weight: 600;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.action-btn {
    padding: 22px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    min-height: 120px;
    justify-content: center;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
}

.action-btn i {
    font-size: 28px;
}

/* Recent Activity */
.recent-activity {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.recent-activity h2 {
    margin-bottom: 25px;
    color: var(--dark-color);
    font-size: 22px;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    padding: 18px;
    background: var(--gray-100);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s;
}

.activity-item:hover {
    background: var(--gray-200);
    transform: translateX(5px);
}

.activity-item .time {
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.activity-item .description {
    color: var(--dark-color);
    font-weight: 500;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-200);
}

.page-header h2,
.page-header h3 {
    color: var(--dark-color);
    font-size: 26px;
    font-weight: 600;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
    background: var(--gray-500);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--gray-600);
}

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

.btn-success:hover {
    background: #389E0D;
}

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

.btn-danger:hover {
    background: #C82333;
}

.btn-info {
    background: #17A2B8;
    color: var(--white);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-info:hover {
    background: #138496;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Filter Section */
.filter-section {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-group input,
.filter-group select {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Table */
.table-container {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
}

.data-table th,
.data-table td {
    padding: 16px 20px;
    text-align: left;
}

.data-table th {
    font-weight: 600;
    font-size: 14px;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: var(--gray-100);
}

.data-table td {
    font-size: 14px;
    color: var(--dark-color);
}

.no-data {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
    font-style: italic;
}

/* Form */
.form-container {
    background: var(--white);
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    max-width: 900px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

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

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--gray-600);
    font-size: 12px;
}

/* Info Card */
.info-card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    max-width: 900px;
}

.info-row {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--gray-200);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    flex: 0 0 200px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 14px;
}

.info-value {
    flex: 1;
    color: var(--gray-700);
    font-size: 14px;
}

.info-text {
    text-align: center;
    color: var(--gray-500);
    padding: 40px;
    font-style: italic;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--gray-300);
}

.tab-btn {
    padding: 14px 28px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Arsip Grid */
.arsip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.arsip-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.2s ease;
}

.arsip-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.1);
}

.arsip-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.arsip-icon {
    font-size: 36px;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 8px;
}

.arsip-info {
    flex: 1;
    min-width: 0;
}

.arsip-info h4 {
    margin: 0 0 8px 0;
    color: var(--dark-color);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.arsip-info p {
    font-size: 13px;
    color: var(--gray-600);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.arsip-info p i {
    width: 14px;
    font-size: 12px;
    color: var(--gray-500);
}

.arsip-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--dark-color);
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray-600);
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Preview */
.preview-container {
    margin-top: 15px;
    padding: 15px;
    background: var(--gray-100);
    border-radius: 8px;
    border: 2px dashed var(--gray-400);
}

.preview-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--white);
    border-radius: 6px;
}

.preview-file i {
    font-size: 24px;
    color: var(--primary-color);
}

.preview-info {
    flex: 1;
}

.preview-info p {
    margin: 0;
    font-size: 14px;
    color: var(--dark-color);
}

.preview-info small {
    color: var(--gray-600);
}

/* Surat Builder Container */
.surat-builder-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

.surat-form-panel {
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #e0e0e0;
}

.surat-form-panel::-webkit-scrollbar {
    width: 8px;
}

.surat-form-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.surat-form-panel::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.surat-form-panel::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.form-selector {
    margin-bottom: 28px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.form-selector label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--dark-color);
    font-weight: 700;
    font-size: 16px;
}

.form-selector label i {
    color: var(--primary-color);
    font-size: 20px;
    background: var(--white);
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.2);
}

.dynamic-form {
    animation: fadeIn 0.3s ease;
}

.dynamic-form h3 {
    color: var(--dark-color);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dynamic-form h3::before {
    content: '📝';
    font-size: 24px;
}

.info-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.info-placeholder i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.info-placeholder p {
    font-size: 15px;
    font-style: italic;
}

.surat-preview-panel {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 90px;
    height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
}

.preview-header i {
    color: #ffd700;
    font-size: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.preview-a4-container {
    flex: 1;
    background: #f8f9fa;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    transition: all 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #e0e0e0;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

.preview-a4-container::-webkit-scrollbar {
    width: 8px;
}

.preview-a4-container::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

.preview-a4-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.preview-a4-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Paper Size Classes */
.preview-a4-container.paper-a4 {
    padding: 24px;
}

.preview-a4-container.paper-a4 .surat-preview {
    max-width: 210mm;
    margin: 0 auto 20px auto;
}

.preview-a4-container.paper-f4 {
    padding: 24px;
}

.preview-a4-container.paper-f4 .surat-preview {
    max-width: 215mm;
    margin: 0 auto 20px auto;
}

.preview-a4-container.paper-letter {
    padding: 24px;
}

.preview-a4-container.paper-letter .surat-preview {
    max-width: 216mm;
    margin: 0 auto 20px auto;
}

/* Print Styles for Different Paper Sizes */
@media print {
    .preview-a4-container.paper-a4 {
        width: 210mm;
        height: 297mm;
    }
    
    .preview-a4-container.paper-f4 {
        width: 215mm;
        height: 330mm;
    }
    
    .preview-a4-container.paper-letter {
        width: 216mm;
        height: 279mm;
    }
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--gray-400);
    background: var(--white);
    border-radius: 12px;
    margin: 20px;
    padding: 60px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.preview-placeholder i {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.preview-placeholder p {
    font-size: 16px;
    font-style: italic;
}

/* Surat Preview */
.surat-preview {
    background: var(--white);
    padding: 30px 40px 40px 40px;
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    animation: fadeIn 0.4s ease;
    margin: 0 auto 20px auto;
    max-width: 100%;
    border: 1px solid #e0e0e0;
    min-height: auto;
    width: 100%;
    overflow: visible;
    position: relative;
    box-sizing: border-box;
}

.surat-kop {
    text-align: center;
    border-bottom: 3px double var(--dark-color);
    padding-bottom: 18px;
    margin-bottom: 25px;
    overflow: visible;
    min-height: 120px;
    position: relative;
}

.surat-kop::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--dark-color);
}

.surat-kop img {
    display: block !important;
    margin: 0 auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    max-width: 90px !important;
    max-height: 90px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

.surat-kop h2 {
    font-size: 14px;
    margin-bottom: 3px;
    font-weight: bold;
    line-height: 1.3;
    color: var(--dark-color);
    letter-spacing: 0.3px;
}

.surat-kop p {
    font-size: 10px;
    margin: 3px 0;
    line-height: 1.4;
    color: var(--dark-color);
}

.surat-kop hr {
    border: none;
    border-top: 2px solid var(--dark-color);
    margin: 10px 0;
}

.surat-nomor {
    text-align: center;
    margin-bottom: 25px;
    margin-top: 20px;
}

.surat-nomor h3 {
    font-size: 13px;
    font-weight: bold;
    margin: 8px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.surat-nomor p {
    font-size: 11px;
    margin: 5px 0;
    font-style: italic;
}

.surat-content {
    text-align: justify;
    margin-bottom: 30px;
    font-size: 11px;
    line-height: 1.8;
}

.surat-content p {
    margin: 12px 0;
    text-indent: 40px;
}

.surat-content p:first-child {
    text-indent: 0;
}

.surat-content table {
    margin: 15px 0 15px 40px;
    width: calc(100% - 40px);
    border-collapse: collapse;
}

.surat-content td {
    padding: 4px 8px;
    vertical-align: top;
    font-size: 11px;
    line-height: 1.6;
}

.surat-content td:first-child {
    width: 180px;
    font-weight: 500;
}

.surat-content td:nth-child(2) {
    width: 20px;
    text-align: center;
}

.surat-content strong {
    font-weight: 600;
}

.surat-ttd {
    margin-top: 50px;
    text-align: center;
    margin-left: 55%;
    font-size: 11px;
    line-height: 1.6;
}

.surat-ttd p {
    margin: 8px 0;
}

.surat-ttd p:first-child {
    margin-bottom: 60px;
}

.surat-ttd strong {
    font-weight: bold;
    text-decoration: underline;
}

/* Action buttons for generated surat */
.surat-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.surat-actions button {
    flex: 1;
    max-width: 200px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.surat-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Kop Surat Editor */
.kop-surat-editor {
    background: var(--gray-100);
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    margin-bottom: 25px;
    overflow: hidden;
}

.kop-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.kop-header:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.kop-header i:first-child {
    font-size: 18px;
}

.kop-header span {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.kop-header .toggle-icon {
    font-size: 14px;
    transition: transform 0.3s;
}

.kop-content {
    padding: 20px;
    background: var(--white);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 1200px) {
    .content-area {
        padding: 30px 25px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .top-header {
        padding: 15px 20px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 10px 0;
        scrollbar-width: thin;
    }

    .main-nav::-webkit-scrollbar {
        height: 4px;
    }

    .main-nav .nav-item {
        padding: 10px 15px;
        font-size: 13px;
    }

    .main-nav .nav-item span {
        display: none;
    }

    .main-nav .nav-item i {
        font-size: 20px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .logo i {
        font-size: 28px;
    }
}

@media (max-width: 1024px) {
    .surat-builder-container {
        grid-template-columns: 1fr;
    }

    .surat-preview-panel {
        position: static;
        max-height: 600px;
    }

    .surat-form-panel {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 12px 15px;
    }

    .content-area {
        padding: 20px 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .surat-builder-container {
        gap: 20px;
    }

    .surat-form-panel,
    .surat-preview-panel {
        padding: 15px;
    }

    .preview-a4-container {
        padding: 15px;
    }

    .surat-preview {
        padding: 20px;
    }

    .form-selector label {
        font-size: 14px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .kop-header {
        padding: 12px 15px;
        font-size: 13px;
    }

    .kop-content {
        padding: 15px;
    }

    .stat-card {
        padding: 20px;
        min-height: 100px;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .stat-info h3 {
        font-size: 28px;
    }

    .quick-actions,
    .recent-activity,
    .filter-section,
    .form-container {
        padding: 20px;
    }

    .quick-actions h2,
    .recent-activity h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
        padding-bottom: 15px;
    }

    .page-header h2,
    .page-header h3 {
        font-size: 20px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-group input,
    .filter-group select {
        min-width: 100%;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 15px;
    }

    .arsip-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }

    .tabs {
        gap: 10px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .tabs::-webkit-scrollbar {
        height: 4px;
    }

    .tab-btn {
        padding: 12px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .form-container {
        max-width: 100%;
    }

    .user-info span {
        display: none;
    }

    .header-right {
        gap: 10px;
    }

    .logo h1 {
        font-size: 18px;
    }

    .logo i {
        font-size: 24px;
    }
}

/* Print Styles */
@media print {
    .top-header,
    .page-header,
    .filter-section,
    .modal-footer,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger {
        display: none !important;
    }

    .surat-preview {
        border: none;
        box-shadow: none;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Mobile Optimization */
@media (max-width: 480px) {
    .content-area {
        padding: 15px 10px;
    }

    .stat-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .quick-actions,
    .recent-activity,
    .filter-section {
        padding: 15px;
    }

    .page-header h2,
    .page-header h3 {
        font-size: 18px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-danger {
        padding: 8px 15px;
        font-size: 13px;
    }

    .modal {
        width: 98%;
        max-height: 95vh;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 14px;
    }
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #F6FFED;
    color: var(--success-color);
}

.badge-warning {
    background: #FFFBE6;
    color: var(--warning-color);
}

.badge-danger {
    background: #FFF1F0;
    color: var(--danger-color);
}

.badge-info {
    background: #E6F7FF;
    color: var(--primary-color);
}

.badge-primary {
    background: #E6F7FF;
    color: var(--primary-color);
}

/* File Actions */
.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-actions .btn-sm {
    min-width: 32px;
    padding: 6px 8px;
}

.info-box {
    background: var(--gray-100);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.info-box p {
    margin: 0;
    line-height: 1.6;
}

/* Table cell with file */
.data-table td > div {
    min-width: 200px;
}

/* Responsive file display */
@media (max-width: 768px) {
    .data-table td > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .data-table td > div > span {
        font-size: 12px;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
