/* ============================================
   Sistema GestorCT - Stylesheet Principal
   Fonte: Inter (Google Fonts)
   Cores: Azul (#2563EB) e Branco
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563EB;
    --primary-dark: #1E40AF;
    --primary-light: #3B82F6;
    --secondary: #64748B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1E293B;
    --light: #F8FAFC;
    --white: #FFFFFF;
    --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;
    --sidebar-width: 280px;
    --topbar-height: 70px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--dark);
    background-color: var(--gray-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    align-items: center;
    gap: 4rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.login-box {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-circle {
    margin: 0 auto 1.5rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-600);
    font-size: 15px;
}

.login-form {
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-block {
    width: 100%;
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-help {
    margin-top: 1rem;
    color: var(--gray-500);
}

.login-info {
    color: var(--white);
}

.login-info h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 2rem;
}

.features-list {
    list-style: none;
    margin: 2rem 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 16px;
}

.features-list svg {
    flex-shrink: 0;
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    gap: 1rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-content h4 {
    font-size: 18px;
    margin-bottom: 0.25rem;
}

.stat-content p {
    font-size: 14px;
    opacity: 0.9;
}

.login-page-footer {
    background: rgba(0,0,0,0.2);
    color: var(--white);
    text-align: center;
    padding: 1.5rem;
}

.login-page-footer p {
    margin: 0.5rem 0;
}

.login-page-footer a {
    color: var(--white);
    text-decoration: none;
    margin: 0 0.5rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert svg {
    flex-shrink: 0;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #93C5FD;
}

/* ===== APP LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 20px;
    font-weight: 700;
}

.sidebar-toggle {
    background: rgba(255,255,255,0.1);
    border: none;
    color: var(--white);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    display: none;
}

.sidebar-user {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.user-info h4 {
    font-size: 15px;
    margin-bottom: 0.25rem;
}

.user-info p {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.user-info small {
    font-size: 11px;
    opacity: 0.7;
}

.sidebar-menu {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--white);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    opacity: 0.8;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
    opacity: 1;
}

.menu-item.active {
    background: rgba(255,255,255,0.15);
    opacity: 1;
}

.menu-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.menu-label {
    font-size: 14px;
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--transition);
}

.topbar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gray-700);
    cursor: pointer;
    padding: 0.5rem;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.icon-btn .badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: var(--white);
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: 600;
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.user-menu-btn img,
.avatar-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.avatar-small {
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 200px;
    padding: 0.5rem;
    display: none;
}

.user-menu-dropdown.show {
    display: block;
}

.user-menu-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
}

.user-menu-dropdown a:hover {
    background: var(--gray-100);
}

.user-menu-dropdown hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

/* ===== DASHBOARD ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-primary .stat-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.stat-success .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-warning .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-info .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: var(--gray-600);
    font-size: 14px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.list-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.list-item:hover {
    background: var(--gray-100);
    transform: translateX(2px);
}

.list-item-content h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.list-item-content p {
    font-size: 13px;
    color: var(--gray-600);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.badge-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-500);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-50);
}

.table tr:hover {
    background: var(--gray-50);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 13px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
    }
    
    .login-info {
        display: none;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .topbar {
        padding: 0 1rem;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}