/* ========================================
   CorteMaster - Sistema Web para Barbeiros
   Tema Dark Moderno
   ======================================== */

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-muted: #737373;
    --accent-primary: #667eea;
    --accent-secondary: #764ba2;
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --border-color: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: var(--bg-hover);
}

.sidebar-brand {
    padding: 30px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--accent-gradient);
}

.sidebar-brand h3 {
    font-size: 24px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    margin-top: 5px;
}

.sidebar-menu {
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.menu-section-title {
    padding: 20px 25px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    font-size: 15px;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.sidebar-menu a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.sidebar-menu a:hover {
    color: white;
    padding-left: 30px;
    border-left-color: var(--accent-primary);
}

.sidebar-menu a:hover::after {
    transform: translateX(0);
}

.sidebar-menu a.active {
    background: rgba(102, 126, 234, 0.15);
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
    box-shadow: inset 0 0 20px rgba(102, 126, 234, 0.05);
}

.sidebar-menu a.active i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.sidebar-footer {
    position: relative;
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
    z-index: 10;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.user-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-details p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    background: var(--bg-primary);
}

.top-bar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.page-title i {
    font-size: 32px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.content-area {
    padding: 30px;
}

/* ========================================
   CARDS
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow-lg);
    border-color: var(--accent-primary);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.primary {
    background: rgba(102, 126, 234, 0.1);
    color: var(--accent-primary);
}

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

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

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

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

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

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

/* ========================================
   TABLES
   ======================================== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

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

.card-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

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

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

thead th {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

tbody td {
    padding: 15px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

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

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

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

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* ========================================
   LOADING
   ======================================== */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
}

.spinner {
    border: 3px solid var(--bg-tertiary);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
        width: 280px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .mobile-close-btn {
        display: block;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 999;
        backdrop-filter: blur(4px);
        transition: opacity 0.3s ease;
    }

    .sidebar.mobile-open ~ .mobile-overlay {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

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

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    .top-bar {
        padding: 12px 15px;
        padding-left: 60px;
        position: sticky;
        top: 0;
        z-index: 99;
        flex-wrap: wrap;
        gap: 10px;
    }

    .page-title h1 {
        font-size: 20px;
    }

    .page-title i {
        font-size: 24px;
    }

    .top-bar-actions {
        flex-wrap: wrap;
        gap: 10px;
    }

    .top-bar-actions .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .content-area {
        padding: 15px;
    }

    /* Table Responsiveness */
    .card {
        margin-bottom: 20px;
    }

    .card-header {
        padding: 15px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .card-header h2 {
        font-size: 18px;
    }

    .card-body {
        padding: 15px;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
    }

    thead th {
        padding: 12px 8px;
        font-size: 12px;
        white-space: nowrap;
    }

    tbody td {
        padding: 12px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Form Responsiveness */
    .form-control {
        padding: 10px 14px;
        font-size: 14px;
    }

    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }

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

    /* Adjust modal width */
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }

    /* Notification button mobile */
    .notification-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .profile-photo {
        width: 40px;
        height: 40px;
    }

    /* Badge adjustments */
    .badge {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* Alert adjustments */
    .alert {
        padding: 12px 15px;
        font-size: 13px;
    }
}

/* Mobile específico - telas pequenas */
@media (max-width: 576px) {
    .top-bar {
        padding: 10px 12px;
        padding-left: 55px;
    }

    .page-title h1 {
        font-size: 18px;
    }

    .content-area {
        padding: 12px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-label {
        font-size: 12px;
    }

    .card-header {
        padding: 12px;
    }

    .card-header h2 {
        font-size: 16px;
    }

    .card-body {
        padding: 12px;
    }

    thead th,
    tbody td {
        padding: 10px 6px;
        font-size: 12px;
    }

    .top-bar-actions .btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile Toggle & Close Buttons */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    width: 45px;
    height: 45px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    z-index: 1001;
    color: var(--text-primary);
    font-size: 20px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

@media (max-width: 992px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

.mobile-menu-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: scale(1.05);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.mobile-menu-toggle.menu-open {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.mobile-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
}

.mobile-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

@media (max-width: 992px) {
    .mobile-close-btn {
        display: flex;
    }
}

.mobile-overlay {
    display: none;
}

/* ========================================
   LOGIN PAGE
   ======================================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px var(--shadow-lg);
}

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

.login-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--accent-gradient);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form {
    margin-top: 30px;
}

.login-footer {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   NOTIFICAÇÕES E PERFIL
   ======================================== */
.notification-btn {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.notification-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
}

.profile-photo {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo i {
    font-size: 20px;
    color: var(--accent-primary);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ========================================
   ADDITIONAL MOBILE RESPONSIVE IMPROVEMENTS
   ======================================== */
@media (max-width: 992px) {
    /* Form groups mobile */
    .form-group {
        margin-bottom: 15px;
    }

    /* Search forms mobile - stack vertically */
    form[style*="display: flex"] {
        flex-direction: column !important;
    }

    form[style*="display: flex"] .form-control {
        margin-bottom: 10px;
        width: 100% !important;
    }

    form[style*="display: flex"] .btn {
        width: 100%;
    }

    /* Card headers mobile */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-header .btn {
        width: 100%;
        margin-top: 10px;
    }

    /* Stats grid mobile spacing */
    .stats-grid {
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {
    /* Better table scrolling on very small screens */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    /* Compact buttons */
    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Better spacing */
    .content-area > * {
        margin-bottom: 15px;
    }
}