/* ==========================================================================
   Talão TEC - Premium CSS Design System
   ========================================================================== */

/* Design Tokens & Variables */
:root {
    --font-primary: 'Outfit', sans-serif;

    /* Premium Midnight Slate Dark Palette */
    --color-bg-primary: #090d16;
    --color-bg-secondary: #111827;
    --color-bg-sidebar: #0b0f19;
    --color-sidebar-hover: #1f2937;
    --color-sidebar-active: #4f46e5;

    --color-primary: #6366f1;
    --color-primary-light: #818cf8;
    --color-primary-dark: #4f46e5;

    --color-success: #10b981;
    --color-success-light: #34d399;
    --color-success-dark: #065f46;

    --color-warning: #f59e0b;
    --color-danger: #ef4444;

    --color-text-main: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-text-light: #ffffff;
    --color-text-muted-light: #94a3b8;

    --color-border: #1f2937;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-indigo: 0 10px 15px -3px rgba(99, 102, 241, 0.2);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
}

/* Layout Framework */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Overlay for Mobile Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 998;
    transition: var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--color-bg-sidebar);
    color: var(--color-text-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition-normal);
    z-index: 999;
}

.sidebar-brand {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.brand-logo {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-indigo);
}

.brand-logo i {
    font-size: 1.25rem;
    color: white;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #c7d2fe);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-badge {
    font-size: 0.7rem;
    color: var(--color-primary-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar-close {
    display: none;
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted-light);
    font-size: 1.25rem;
}

.sidebar-close:hover {
    color: white;
}

/* Navigation List */
.sidebar-nav {
    flex: 1;
    padding: 2rem 1rem;
    overflow-y: auto;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--color-text-muted-light);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-normal);
}

.nav-item a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    transition: var(--transition-fast);
}

.nav-item:hover a {
    background-color: var(--color-sidebar-hover);
    color: white;
}

.nav-item:hover a i {
    transform: scale(1.1);
    color: var(--color-primary-light);
}

.nav-item.active a {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-indigo);
}

.nav-item.active a i {
    color: white;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--color-sidebar-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.user-avatar i {
    font-size: 1.2rem;
    color: var(--color-text-muted-light);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 0.75rem;
    color: var(--color-text-muted-light);
}

.logout-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted-light);
    transition: var(--transition-normal);
}

.logout-btn:hover {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

/* Main Container Area */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar Header */
.topbar {
    height: 70px;
    background-color: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.sidebar-toggle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.sidebar-toggle:hover {
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
}

.topbar-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.topbar-btn {
    position: relative;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.topbar-btn:hover {
    color: var(--color-text-main);
}

.badge-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--color-danger);
    border-radius: 50%;
    border: 2px solid var(--color-bg-secondary);
}

.topbar-divider {
    width: 1px;
    height: 24px;
    background-color: var(--color-border);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    padding: 2rem;
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-main);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Footer styling */
.main-footer {
    padding: 1.5rem 2rem;
    background-color: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-version {
    font-weight: 500;
    color: var(--color-text-muted);
}

/* ==========================================================================
   12-Column Responsive Grid System
   ========================================================================== */
.grid-12 {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.col-1 {
    grid-column: span 1;
}

.col-2 {
    grid-column: span 2;
}

.col-3 {
    grid-column: span 3;
}

.col-4 {
    grid-column: span 4;
}

.col-5 {
    grid-column: span 5;
}

.col-6 {
    grid-column: span 6;
}

.col-7 {
    grid-column: span 7;
}

.col-8 {
    grid-column: span 8;
}

.col-9 {
    grid-column: span 9;
}

.col-10 {
    grid-column: span 10;
}

.col-11 {
    grid-column: span 11;
}

.col-12 {
    grid-column: span 12;
}

/* Responsive Medium (md) devices (tablets, less than 992px) */
@media (max-width: 992px) {
    .col-md-1 {
        grid-column: span 1;
    }

    .col-md-2 {
        grid-column: span 2;
    }

    .col-md-3 {
        grid-column: span 3;
    }

    .col-md-4 {
        grid-column: span 4;
    }

    .col-md-5 {
        grid-column: span 5;
    }

    .col-md-6 {
        grid-column: span 6;
    }

    .col-md-7 {
        grid-column: span 7;
    }

    .col-md-8 {
        grid-column: span 8;
    }

    .col-md-9 {
        grid-column: span 9;
    }

    .col-md-10 {
        grid-column: span 10;
    }

    .col-md-11 {
        grid-column: span 11;
    }

    .col-md-12 {
        grid-column: span 12;
    }
}

/* Responsive Small (sm) devices (mobile phones, less than 576px) */
@media (max-width: 576px) {
    .col-sm-1 {
        grid-column: span 1;
    }

    .col-sm-2 {
        grid-column: span 2;
    }

    .col-sm-3 {
        grid-column: span 3;
    }

    .col-sm-4 {
        grid-column: span 4;
    }

    .col-sm-5 {
        grid-column: span 5;
    }

    .col-sm-6 {
        grid-column: span 6;
    }

    .col-sm-7 {
        grid-column: span 7;
    }

    .col-sm-8 {
        grid-column: span 8;
    }

    .col-sm-9 {
        grid-column: span 9;
    }

    .col-sm-10 {
        grid-column: span 10;
    }

    .col-sm-11 {
        grid-column: span 11;
    }

    .col-sm-12 {
        grid-column: span 12;
    }
}

/* ==========================================================================
   Premium UI Components (Cards, Statuses)
   ========================================================================== */

/* Dashboard Stats Cards */
.card-stat {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-normal);
}

.card-stat:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--color-text-main);
    letter-spacing: -1px;
}

.stat-change {
    font-size: 0.775rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.stat-change.up {
    color: var(--color-success);
}

.stat-change.down {
    color: var(--color-danger);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--color-primary);
}

.stat-icon.success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.stat-icon.warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.stat-icon.danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--color-danger);
}

/* Info Cards */
.card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.card-body {
    padding: 1.5rem;
    flex: 1;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table-modern th {
    padding: 1rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.table-modern td {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--color-border);
}

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

.table-modern tbody tr {
    transition: var(--transition-fast);
}

.table-modern tbody tr:hover {
    background-color: var(--color-bg-primary);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.775rem;
    font-weight: 600;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--color-danger);
}

/* ==========================================================================
   Responsive Sidebar Handling
   ========================================================================== */
@media (min-width: 993px) {
    .sidebar-toggle {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-close {
        display: block;
    }

    .topbar {
        padding: 0 1rem;
    }

    .main-content {
        padding: 1.5rem;
    }
}

/* Action Cards */
.btn-action {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
    background-color: var(--color-bg-primary);
}

.btn-action:hover {
    border-color: var(--color-primary-light);
    background-color: var(--color-bg-secondary);
    box-shadow: var(--shadow-md);
    transform: translateX(6px);
}

/* ==========================================================================
   CRUD Modals, Forms & Premium Action Buttons
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 13, 22, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    transition: opacity var(--transition-normal);
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn var(--transition-normal);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.modal-close {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
}

/* Premium Form Elements */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-main);
    padding: 0.75rem 1rem;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary-light);
    outline: none;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Action Buttons */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-text-light);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    box-shadow: var(--shadow-indigo);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-secondary {
    background-color: var(--color-sidebar-hover);
    color: var(--color-text-main);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-border);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--color-text-light);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--color-text-light);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

/* Action Buttons in Grid */
.btn-icon {
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    color: var(--color-text-muted);
}

.btn-icon:hover {
    background-color: var(--color-sidebar-hover);
    color: var(--color-text-main);
}

.btn-icon.edit:hover {
    color: var(--color-primary-light);
}

.btn-icon.delete:hover {
    color: var(--color-danger);
}