/**
 * EAD Vault - Admin Panel Styles
 * Modern professional design
 */

:root {
    --primary: #4a90d9;
    --primary-dark: #3a7bc8;
    --primary-light: #e8f2fc;
    --success: #28a745;
    --success-light: #d4edda;
    --warning: #ffc107;
    --warning-light: #fff3cd;
    --danger: #dc3545;
    --danger-light: #f8d7da;
    --info: #17a2b8;
    --info-light: #d1ecf1;

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;

    --transition: all 0.15s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
}

/* ==================== Navigation ==================== */
.admin-nav {
    background: var(--gray-800);
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-brand a {
    color: #fff;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.nav-menu {
    list-style: none;
    display: flex;
    margin-left: 40px;
    gap: 4px;
}

.nav-menu li a {
    color: var(--gray-300);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-menu li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-menu li.active a {
    color: #fff;
    background: var(--primary);
}

.nav-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
}

/* ==================== Main Content ==================== */
.admin-main {
    padding: 32px 24px;
    min-height: calc(100vh - 60px - 60px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== Page Header ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.page-header .subtitle {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.page-header-actions {
    display: flex;
    gap: 8px;
}

/* ==================== Alerts ==================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert-success {
    background: var(--success-light);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: var(--danger-light);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: var(--warning-light);
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: var(--info-light);
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ==================== Badges ==================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success { background: var(--success-light); color: #155724; }
.badge-warning { background: var(--warning-light); color: #856404; }
.badge-danger { background: var(--danger-light); color: #721c24; }
.badge-primary { background: var(--primary-light); color: #1e5a9e; }
.badge-info { background: var(--info-light); color: #0c5460; }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

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

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

.btn-success:hover {
    background: #218838;
}

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

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

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

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-block {
    width: 100%;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stats-small .stat-card {
    padding: 16px 20px;
}

.stats-small .stat-value {
    font-size: 1.75rem;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-danger::before { background: var(--danger); }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--gray-500);
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-link:hover {
    text-decoration: underline;
}

/* ==================== Content Sections ==================== */
.content-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

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

.section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* ==================== Data Tables ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table .row-highlight {
    background: var(--warning-light);
}

.data-table .row-highlight:hover {
    background: #fff3cd;
}

.data-table td .text-muted {
    font-size: 0.8rem;
}

.data-table .actions {
    white-space: nowrap;
}

.data-table .actions .btn {
    margin-left: 4px;
}

.data-table .actions .btn:first-child {
    margin-left: 0;
}

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

.production-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

.production-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

.production-card .card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.production-card .card-body {
    padding: 20px;
}

.production-card .theater-name {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.production-card .card-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 12px;
}

.production-card .card-stat {
    text-align: center;
}

.production-card .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    display: block;
}

.production-card .card-stat.stat-warning .stat-number {
    color: #856404;
}

.production-card .card-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.production-card .card-actions {
    padding: 16px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 8px;
}

/* ==================== Forms ==================== */
.content-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.content-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-800);
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
    background: #fff;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-group .hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ==================== Detail Grid ==================== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.detail-item {
    padding: 12px 0;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.detail-item span {
    color: var(--gray-800);
    font-size: 0.95rem;
}

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

.detail-header h3 {
    margin: 0;
}

/* ==================== Filters ==================== */
.filters {
    margin-bottom: 24px;
}

.filter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

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

.filter-select {
    padding: 8px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: #fff;
    min-width: 150px;
}

.filter-search {
    flex: 1;
    min-width: 200px;
}

.filter-search input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ==================== Quick Actions ==================== */
.quick-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--gray-700);
    transition: var(--transition);
}

.quick-action:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.action-icon {
    width: 40px;
    height: 40px;
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
}

.quick-action:hover .action-icon {
    background: var(--primary);
    color: #fff;
}

.action-text {
    font-weight: 600;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 20px;
}

/* ==================== Timeline ==================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gray-400);
    border: 2px solid #fff;
}

.timeline-item.success .timeline-marker { background: var(--success); }
.timeline-item.danger .timeline-marker { background: var(--danger); }
.timeline-item.warning .timeline-marker { background: var(--warning); }
.timeline-item.info .timeline-marker { background: var(--info); }

.timeline-content strong {
    display: block;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.timeline-content .text-muted {
    font-size: 0.8rem;
}

/* ==================== Copy Link ==================== */
.copy-link {
    display: flex;
    gap: 8px;
}

.copy-link input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--gray-50);
    color: var(--gray-600);
}

/* ==================== Email Preview ==================== */
.email-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    font-size: 0.9rem;
}

.email-preview hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 15px 0;
}

.email-preview p {
    margin-bottom: 12px;
}

/* ==================== Password Strength ==================== */
.password-strength {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    transition: var(--transition);
    border-radius: 2px;
}

.password-strength-fill.weak { width: 25%; background: var(--danger); }
.password-strength-fill.fair { width: 50%; background: var(--warning); }
.password-strength-fill.good { width: 75%; background: var(--info); }
.password-strength-fill.strong { width: 100%; background: var(--success); }

/* ==================== Login Page ==================== */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-box {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.login-header p {
    opacity: 0.9;
    font-size: 0.9rem;
}

.login-form {
    padding: 30px;
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

/* ==================== Footer ==================== */
.admin-footer {
    padding: 20px 24px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.85rem;
    border-top: 1px solid var(--gray-200);
    background: #fff;
}

/* ==================== Utility Classes ==================== */
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: 0.8rem; }
.block { display: block; }

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .admin-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 16px;
        gap: 12px;
    }

    .nav-menu {
        order: 3;
        width: 100%;
        margin-left: 0;
        overflow-x: auto;
    }

    .nav-user {
        margin-left: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

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

    .detail-grid {
        grid-template-columns: 1fr;
    }

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

    .filter-search {
        width: 100%;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }
}
