:root {
    --primary-color: #4a235a;
    --primary-light: #76448a;
    --primary-dark: #2a0845;
    --text-color: #333333;
    --text-light: #666666;
    --bg-color: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --success: #28a745;
    --danger: #dc3545;
    --sidebar-width: 250px;
    --header-height: 60px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Auth View */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-group label span {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(118, 68, 138, 0.1);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    width: 100%;
}

.btn-primary {
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(to right, var(--primary-light), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 35, 90, 0.3);
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    height: var(--header-height);
    background: linear-gradient(to right, var(--primary-dark), var(--primary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 10px;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
}

.sidebar-menu a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: var(--text-light);
}

.sidebar-menu a:hover, .sidebar-menu a.active {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.sidebar-menu a.active i {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.avatar {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.logout-btn {
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
}

/* Page Content */
.page-content {
    padding: 30px;
    flex-grow: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-title {
    font-size: 24px;
    color: var(--text-color);
    font-weight: 700;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sm:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

/* Table Card */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

th {
    background-color: #f1f3f5;
    color: var(--text-color);
    font-weight: 600;
    white-space: nowrap;
}

td {
    color: var(--text-light);
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background-color: #f8f9fa;
}

.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background-color: #d4edda; color: #155724; }
.badge-warning { background-color: #fff3cd; color: #856404; }

.action-btns {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    background: transparent;
}

.btn-view { color: #0d6efd; }
.btn-view:hover { background: #e9ecef; }
.btn-edit { color: #198754; }
.btn-edit:hover { background: #e9ecef; }
.btn-delete { color: #dc3545; }
.btn-delete:hover { background: #e9ecef; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    width: 95%;
    max-width: 650px;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 30px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-secondary {
    background: #e9ecef;
    color: var(--text-color);
}
.btn-secondary:hover {
    background: #dde2e6;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Toolbars */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    display: flex;
    align-items: center;
}
.search-box input {
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 6px 0 0 6px;
    outline: none;
}
.search-btn {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 9px 15px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
}

/* Vista previa PDF/XML (iframe + placeholder) */
.pdf-viewer-container {
    background: #323639;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}
.pdf-page {
    background: white;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: left;
}
.pdf-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 2px solid #000;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.pdf-title {
    border: 2px solid #000;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
}
