/* GenWorks - Corporate Enterprise Industrial Design 2025 */

:root {
    /* Primary Colors - Industrial Blue/Steel */
    --primary-50: #e8f4fc;
    --primary-100: #d1e9f9;
    --primary-200: #a3d3f3;
    --primary-300: #75bded;
    --primary-400: #47a7e7;
    --primary-500: #1a91e1;
    --primary-600: #1574b4;
    --primary-700: #105787;
    --primary-800: #0b3a5a;
    --primary-900: #051d2d;

    /* Accent Colors - Industrial Orange */
    --accent-500: #f59e0b;
    --accent-600: #d97706;

    /* Neutral Colors - Steel Gray */
    --neutral-50: #f8fafc;
    --neutral-100: #f1f5f9;
    --neutral-200: #e2e8f0;
    --neutral-300: #cbd5e1;
    --neutral-400: #94a3b8;
    --neutral-500: #64748b;
    --neutral-600: #475569;
    --neutral-700: #334155;
    --neutral-800: #1e293b;
    --neutral-900: #0f172a;

    /* Status Colors */
    --success-500: #22c55e;
    --success-600: #16a34a;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --info-500: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--neutral-100);
    color: var(--neutral-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--neutral-900);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

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

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-800) 0%, var(--primary-900) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-500);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

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

.nav-section {
    padding: 0.5rem 1rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-400);
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--primary-200);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin: 0.25rem 0.5rem;
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.nav-link.active {
    background: var(--primary-500);
    color: white;
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.nav-link.active .nav-link-icon {
    opacity: 1;
}

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

/* Top Header */
.top-header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--neutral-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--neutral-100);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.header-user:hover {
    background: var(--neutral-200);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

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

.user-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--neutral-800);
}

.user-role {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

/* Content Area */
.content-area {
    padding: 2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--neutral-800);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--neutral-200);
    background: var(--neutral-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* Stats Cards */
.stats-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-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { background: var(--primary-100); color: var(--primary-600); }
.stat-icon.green { background: #dcfce7; color: var(--success-600); }
.stat-icon.orange { background: #fef3c7; color: var(--warning-600); }
.stat-icon.red { background: #fee2e2; color: var(--danger-600); }

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--neutral-500);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--neutral-900);
    line-height: 1;
}

.stat-change {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-change.positive { color: var(--success-600); }
.stat-change.negative { color: var(--danger-600); }

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

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

.data-table th,
.data-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--neutral-200);
}

.data-table th {
    background: var(--neutral-50);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--neutral-600);
}

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

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

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background: #dcfce7;
    color: var(--success-600);
}

.status-online::before {
    background: var(--success-500);
    animation: pulse 2s infinite;
}

.status-offline {
    background: var(--neutral-200);
    color: var(--neutral-600);
}

.status-offline::before {
    background: var(--neutral-400);
}

.status-fault {
    background: #fee2e2;
    color: var(--danger-600);
}

.status-fault::before {
    background: var(--danger-500);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-600);
}

.btn-secondary {
    background: var(--neutral-200);
    color: var(--neutral-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--neutral-300);
}

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

.btn-success:hover:not(:disabled) {
    background: var(--success-600);
}

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

.btn-danger:hover:not(:disabled) {
    background: var(--danger-600);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--neutral-300);
    color: var(--neutral-700);
}

.btn-outline:hover:not(:disabled) {
    background: var(--neutral-100);
    border-color: var(--neutral-400);
}

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

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

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

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

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-md);
    background: white;
    color: var(--neutral-800);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input::placeholder {
    color: var(--neutral-400);
}

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

.form-error {
    font-size: 0.75rem;
    color: var(--danger-500);
    margin-top: 0.375rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: 0.375rem;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--neutral-700);
    cursor: pointer;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--neutral-500);
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--neutral-100);
    color: var(--neutral-700);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--neutral-200);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-content {
    flex: 1;
}

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

.alert-success {
    background: #dcfce7;
    color: var(--success-600);
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: var(--danger-600);
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: var(--warning-600);
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: var(--info-500);
    border: 1px solid #bfdbfe;
}

/* Progress Bar */
.progress-bar {
    height: 8px;
    background: var(--neutral-200);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width var(--transition-normal);
}

.progress-fill.green { background: var(--success-500); }
.progress-fill.orange { background: var(--warning-500); }
.progress-fill.red { background: var(--danger-500); }
.progress-fill.blue { background: var(--primary-500); }

/* Gauge */
.gauge-container {
    position: relative;
    width: 120px;
    height: 120px;
}

.gauge-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gauge-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-800);
}

.gauge-label {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

/* ATS Card */
.ats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.ats-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--neutral-200);
    overflow: hidden;
    transition: all var(--transition-fast);
}

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

.ats-card-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ats-card-title {
    font-weight: 600;
    font-size: 1rem;
}

.ats-card-uid {
    font-size: 0.75rem;
    opacity: 0.8;
    font-family: monospace;
}

.ats-card-body {
    padding: 1.5rem;
}

.ats-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.ats-metric {
    text-align: center;
    padding: 1rem;
    background: var(--neutral-50);
    border-radius: var(--radius-md);
}

.ats-metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--neutral-800);
}

.ats-metric-label {
    font-size: 0.75rem;
    color: var(--neutral-500);
    margin-top: 0.25rem;
}

.ats-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--neutral-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--neutral-50);
}

.ats-last-update {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-900) 100%);
    padding: 2rem;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    padding: 2rem;
    text-align: center;
    background: var(--neutral-50);
    border-bottom: 1px solid var(--neutral-200);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.login-logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-500);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
}

.login-logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-800);
}

.login-subtitle {
    color: var(--neutral-500);
    font-size: 0.875rem;
}

.login-body {
    padding: 2rem;
}

.login-footer {
    padding: 1.5rem 2rem;
    background: var(--neutral-50);
    border-top: 1px solid var(--neutral-200);
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--neutral-500);
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--neutral-200);
    min-width: 180px;
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    color: var(--neutral-700);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: background var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--neutral-100);
}

.dropdown-item.danger {
    color: var(--danger-500);
}

.dropdown-item.danger:hover {
    background: #fee2e2;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--neutral-200);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.875rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--neutral-500);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--neutral-700);
}

.tab.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-500);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--neutral-400);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--neutral-700);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--neutral-500);
    font-size: 0.875rem;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--neutral-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.hidden { display: none; }
.block { display: block; }

/* Mobile Menu Toggle Button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--neutral-700);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

/* Mobile Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .menu-toggle {
        display: flex !important;
    }

    .sidebar-overlay {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ats-grid {
        grid-template-columns: 1fr;
    }

    /* Dashboard grid pe tablet */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    /* Modal pe tablet */
    .modal {
        max-width: 90%;
        margin: 1rem;
    }

    /* User info in header - ascunde textul */
    .user-info {
        display: none;
    }

    .header-user {
        padding: 0.5rem;
    }
}

/* Responsive - Mobile */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

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

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .top-header {
        padding: 0.75rem 1rem;
    }

    .page-title {
        font-size: 1rem;
    }

    .content-area {
        padding: 1rem;
    }

    .card {
        border-radius: var(--radius-lg);
    }

    .card-header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .card-header .btn {
        width: 100%;
    }

    .card-body {
        padding: 1rem;
    }

    /* Tabele responsive */
    .table-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.5rem;
        white-space: nowrap;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 1rem;
    }

    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 1rem;
    }

    /* Ascunde coloane mai putin importante pe mobile */
    .data-table .hide-mobile {
        display: none;
    }

    /* ATS Cards pe mobile */
    .ats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .ats-card-header {
        padding: 1rem;
    }

    .ats-card-body {
        padding: 1rem;
    }

    .ats-card-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .ats-card-footer .btn {
        width: 100%;
    }

    .ats-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .ats-metric {
        padding: 0.75rem;
    }

    .ats-metric-value {
        font-size: 1.25rem;
    }

    /* Modal pe mobile */
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        margin: 0;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        flex-direction: column;
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Forms pe mobile */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-input,
    .form-select {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Previne zoom pe iOS */
    }

    /* Butoane pe mobile */
    .btn {
        padding: 0.75rem 1rem;
    }

    .btn-lg {
        padding: 1rem 1.25rem;
    }

    /* Flex utilities pe mobile */
    .flex-mobile-col {
        flex-direction: column;
    }

    .gap-mobile-2 {
        gap: 0.5rem;
    }

    /* Filtre pe mobile */
    .filters-row {
        flex-direction: column;
    }

    .filters-row .form-group {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .filters-row .form-select {
        width: 100%;
    }

    /* Login pe mobile */
    .login-container {
        padding: 1rem;
    }

    .login-card {
        border-radius: var(--radius-lg);
    }

    .login-header {
        padding: 1.5rem;
    }

    .login-body {
        padding: 1.5rem;
    }

    .login-logo-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .login-logo-text {
        font-size: 1.5rem;
    }

    /* Profil pe mobile */
    .profile-grid {
        grid-template-columns: 1fr !important;
    }

    /* Dropdown pe mobile */
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        min-width: 100%;
        padding: 1rem;
        transform: translateY(100%);
    }

    .dropdown.active .dropdown-menu {
        transform: translateY(0);
    }

    .dropdown-item {
        padding: 1rem;
        justify-content: center;
    }

    /* Alerts pe mobile */
    .alert {
        padding: 0.875rem 1rem;
    }

    /* Status badge mai mic pe mobile */
    .status-badge {
        padding: 0.25rem 0.5rem;
        font-size: 0.6875rem;
    }

    /* Actions buttons inline */
    .actions-cell {
        display: flex;
        gap: 0.25rem;
    }

    .actions-cell .btn {
        padding: 0.375rem;
    }

    /* Empty state pe mobile */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon {
        width: 48px;
        height: 48px;
    }
}

/* Responsive - Extra small */
@media (max-width: 375px) {
    .ats-metrics {
        grid-template-columns: 1fr;
    }

    .stats-grid .stat-card {
        flex-direction: column;
        text-align: center;
    }

    .stat-icon {
        margin: 0 auto;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .nav-link {
        min-height: 48px;
    }

    .form-check {
        min-height: 44px;
    }

    .form-check-input {
        width: 22px;
        height: 22px;
    }

    .dropdown-item {
        min-height: 48px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .login-container {
        padding: 1rem;
    }

    .login-card {
        max-width: 500px;
    }

    .modal {
        max-height: 85vh;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .btn,
    .modal-overlay,
    .menu-toggle,
    .sidebar-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .content-area {
        padding: 0;
    }
}
