/* assets/css/style.css - Premium SaaS Style */

:root {
    /* Primary Colors - Indigo theme */
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --primary-bg: #EEF2FF;
    
    /* Secondary Colors */
    --secondary: #7C3AED;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    /* Grayscale */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;8
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: var(--transition);
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-brand .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-brand .logo span {
    color: var(--gray-900);
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.sidebar-nav .nav-item:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.sidebar-nav .nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.sidebar-nav .nav-item .icon {
    width: 1.5rem;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.sidebar-nav .nav-item .badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 2rem;
    min-height: 100vh;
}

/* Top Bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 2rem;
}

.topbar h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
}

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

/* Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

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

.stat-card .label {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-card .trend {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

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

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

.stat-card .icon-bg {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    float: right;
}

.icon-bg.primary { background: var(--primary-bg); color: var(--primary); }
.icon-bg.success { background: #D1FAE5; color: var(--success); }
.icon-bg.warning { background: #FEF3C7; color: var(--warning); }
.icon-bg.danger { background: #FEE2E2; color: var(--danger); }

/* Tables */
.table-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

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

.table thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

.table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.table .actions {
    display: flex;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    background: var(--gray-100);
    color: var(--gray-700);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: #D1FAE5; color: #065F46; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control.error {
    border-color: var(--danger);
}

.form-control.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--gray-600);
    transform: rotate(90deg);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background: white;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary);
    min-width: 300px;
    max-width: 500px;
    pointer-events: auto;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

.toast .toast-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast .toast-message {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .toast-container {
        left: 1rem;
        right: 1rem;
    }
    
    .toast {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
/* Sidebar close button (mobile) */
.sidebar-close {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease;
}
.sidebar-close:hover {
    color: var(--gray-700);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    margin-top: auto;
}
.sidebar-footer .version {
    font-size: 0.75rem;
    color: var(--gray-400);
}

/* Logout item styling */
.logout-item {
    margin-top: 0.5rem;
    border-top: 1px solid var(--gray-200);
    padding-top: 0.75rem !important;
}

/* Notification button */
.btn-notification {
    position: relative;
    background: none;
    border: none;
    font-size: 1.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.btn-notification:hover {
    transform: scale(1.1);
}

/* Ghost button */
.btn-ghost {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    transition: color 0.3s ease;
}
.btn-ghost:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Search results positioning */
.search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 100;
}
.search-results.active {
    display: block;
}

/* Mobile responsive overrides */
@media (max-width: 768px) {
    .sidebar-close {
        display: block;
    }
    .sidebar-brand {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .sidebar-footer {
        display: none;
    }
    .logout-item {
        margin-top: 0.25rem;
    }
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
        position: sticky;
        top: 0;
        height: 100vh;
    }
    .mobile-toggle {
        display: none !important;
    }
    .sidebar-close {
        display: none !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
}