/* =====================================================
   ESCOLA DE MÚSICA - Admin Panel Styles
   Clean, modern design with musical identity
   ===================================================== */

:root {
    /* Color palette - warm earth tones with musical accent */
    --primary: #2D4A7A;
    --primary-light: #3D6098;
    --primary-dark: #1E3355;
    --accent: #E8913A;
    --accent-light: #F4A85A;
    --accent-dark: #C97A2E;
    
    --bg-page: #F5F3F0;
    --bg-card: #FFFFFF;
    --bg-sidebar: #1B2B44;
    --bg-sidebar-hover: #253A56;
    --bg-input: #FAF9F7;
    
    --text-primary: #2C2C2C;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-sidebar: #C8D5E2;
    --text-sidebar-active: #FFFFFF;
    
    --border: #E5E2DD;
    --border-light: #F0EDE8;
    
    --success: #3B9E6F;
    --error: #D64545;
    --warning: #E0993E;
    --info: #4A90B8;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --sidebar-width: 260px;
    --topbar-height: 64px;
    
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== LAYOUT ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}
.sidebar-header {
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: white;
    letter-spacing: 0.01em;
}
.logo i {
    background: var(--accent);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    color: white;
}
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-sidebar);
    font-size: 1.2rem;
    cursor: pointer;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}
.nav-section {
    margin-bottom: 6px;
}
.nav-section-title {
    display: block;
    padding: 10px 22px 4px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    font-weight: 600;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 22px;
    color: var(--text-sidebar);
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.nav-link:hover {
    background: var(--bg-sidebar-hover);
    color: white;
}
.nav-link.active {
    background: var(--bg-sidebar-hover);
    color: white;
    border-left-color: var(--accent);
    font-weight: 500;
}
.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.75;
}
.nav-link.active i, .nav-link:hover i {
    opacity: 1;
}
.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}
.user-details { line-height: 1.3; }
.user-name { display: block; font-size: 0.82rem; color: white; font-weight: 500; }
.user-role { display: block; font-size: 0.7rem; color: var(--text-sidebar); opacity: 0.65; }
.btn-logout {
    color: var(--text-sidebar);
    opacity: 0.5;
    padding: 6px;
    transition: opacity 0.15s;
}
.btn-logout:hover { opacity: 1; color: var(--error); }

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}
.page-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-primary);
}
.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}
.date-display {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.date-display i { margin-right: 5px; }

.content-area {
    padding: 28px;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    overflow: hidden;
}
.card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
}
.card-body { padding: 22px; }
.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-input);
}

/* ===== STAT CARDS (Dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-icon.blue { background: #E8F0FE; color: var(--primary); }
.stat-icon.orange { background: #FFF0E0; color: var(--accent); }
.stat-icon.green { background: #E5F5ED; color: var(--success); }
.stat-icon.red { background: #FDEAEA; color: var(--error); }
.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-primary);
}
.stat-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== TABLES ===== */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.data-table {
    width: 100%;
    font-size: 0.88rem;
}
.data-table thead {
    background: var(--bg-input);
}
.data-table th {
    padding: 11px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.data-table tbody tr {
    transition: background 0.1s;
}
.data-table tbody tr:hover {
    background: #FAFAF8;
}
.data-table .actions {
    white-space: nowrap;
    text-align: right;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-light); color: white; }
.btn-accent {
    background: var(--accent);
    color: white;
}
.btn-accent:hover { background: var(--accent-light); color: white; }
.btn-success {
    background: var(--success);
    color: white;
}
.btn-danger {
    background: var(--error);
    color: white;
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: white;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon.danger:hover { border-color: var(--error); color: var(--error); }

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45,74,122,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}
.search-input-wrapper i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.search-input-wrapper .form-control {
    padding-left: 40px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: slideIn 0.3s ease;
}
.alert-success { background: #E5F5ED; color: #1E6B42; border: 1px solid #C3E6D1; }
.alert-error { background: #FDEAEA; color: #A23030; border: 1px solid #F5C6C6; }
.alert-warning { background: #FFF6E5; color: #8A6420; border: 1px solid #F5E0B0; }
.alert-info { background: #E8F0FE; color: #2A5F8F; border: 1px solid #C0D7F0; }
.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-success { background: #E5F5ED; color: #1E6B42; }
.badge-warning { background: #FFF6E5; color: #8A6420; }
.badge-danger { background: #FDEAEA; color: #A23030; }
.badge-info { background: #E8F0FE; color: #2A5F8F; }
.badge-muted { background: #F0EDE8; color: var(--text-secondary); }

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}
.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
}
.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all 0.15s;
}
.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination .active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.4;
}
.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.empty-state p { font-size: 0.9rem; }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-sidebar) 0%, #2A4060 50%, var(--primary) 100%);
    padding: 20px;
}
.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    padding: 40px 36px;
}
.login-logo {
    text-align: center;
    margin-bottom: 30px;
}
.login-logo .icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 14px;
}
.login-logo h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text-primary);
}
.login-logo p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 4px;
}
.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 11px;
    font-size: 0.95rem;
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close { display: block; }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; }
    .content-area { padding: 18px; }
    .topbar { padding: 0 18px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .topbar, .btn, .search-bar, .pagination { display: none !important; }
    .main-content { margin-left: 0; }
    .content-area { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
    .data-table th { background: #f0f0f0 !important; }
}
