/* ============================================
   MyDevHut AMS - Main Stylesheet
   Colors: Primary #0F172A, Accent #06B6D4, BG #F8FAFC
   Fonts: Inter, Space Grotesk
   ============================================ */

:root {
    --primary: #0F172A;
    --accent: #06B6D4;
    --accent-hover: #0891B2;
    --bg: #F8FAFC;
    --card-bg: #FFFFFF;
    --border: #E2E8F0;
    --text: #1E293B;
    --text-muted: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --sidebar-width: 260px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
}

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

body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
h1, h2, h3, h4, h5 { font-family: 'Space Grotesk', sans-serif; font-weight: 600; }

/* === LOGIN === */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--primary); }
.login-card { background: var(--card-bg); padding: 48px 40px; border-radius: 16px; width: 100%; max-width: 420px; box-shadow: var(--shadow-md); text-align: center; }
.login-logo { margin-bottom: 16px; }
.login-title { font-size: 24px; color: var(--primary); margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 32px; }
.login-form .form-group { margin-bottom: 20px; text-align: left; }
.back-link { display: inline-block; margin-top: 16px; color: var(--accent); text-decoration: none; }

/* === SIDEBAR === */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); background: var(--primary); color: #CBD5E1; display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo { display: flex; align-items: center; gap: 12px; }
.sidebar-brand { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; color: #fff; }
.sidebar-toggle { background: none; border: none; color: #CBD5E1; cursor: pointer; display: none; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: #94A3B8; text-decoration: none; font-size: 14px; transition: all 0.2s; border-left: 3px solid transparent; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,0.05); border-left-color: var(--accent); }
.nav-link.active { color: var(--accent); }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-info { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.user-details { display: flex; flex-direction: column; }
.user-name { color: #fff; font-size: 13px; font-weight: 500; }
.user-role { color: #64748B; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
.logout-link { color: #EF4444 !important; }

/* === MAIN CONTENT === */
.main-content { margin-left: var(--sidebar-width); padding: 32px; min-height: 100vh; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 28px; }

/* === CARDS === */
.card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-header { padding: 16px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h2, .card-header h3 { font-size: 16px; margin: 0; }
.card-body { padding: 24px; }

/* === STATS === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-icon-blue { background: #EFF6FF; color: #3B82F6; }
.stat-icon-green { background: #ECFDF5; color: #10B981; }
.stat-icon-purple { background: #F5F3FF; color: #8B5CF6; }
.stat-icon-orange { background: #FFF7ED; color: #F97316; }
.stat-icon-yellow { background: #FEFCE8; color: #EAB308; }
.stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; display: block; }
.stat-label { color: var(--text-muted); font-size: 13px; }

/* === TABLE === */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px 16px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 2px solid var(--border); font-weight: 600; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover { background: #F8FAFC; }
.truncate { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === FORMS === */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-family: 'Inter', sans-serif; transition: border-color 0.2s; background: #fff; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(6,182,212,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.upload-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.filter-bar { margin-bottom: 16px; }
.filter-bar form { display: flex; gap: 12px; align-items: center; }
.filter-bar select, .filter-bar input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); }

/* === BUTTONS === */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: all 0.2s; font-family: 'Inter', sans-serif; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-full { width: 100%; justify-content: center; }

/* === BADGES === */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-admin { background: #FEF3C7; color: #92400E; }
.badge-developer { background: #DBEAFE; color: #1E40AF; }
.badge-client { background: #D1FAE5; color: #065F46; }
.badge-success, .badge-active, .badge-paid, .badge-approved, .badge-published, .badge-completed { background: #D1FAE5; color: #065F46; }
.badge-warning, .badge-pending, .badge-processing, .badge-review, .badge-planning, .badge-draft { background: #FEF3C7; color: #92400E; }
.badge-danger, .badge-inactive, .badge-cancelled, .badge-rejected, .badge-critical, .badge-error { background: #FEE2E2; color: #991B1B; }
.badge-info, .badge-sent, .badge-viewed { background: #DBEAFE; color: #1E40AF; }
.badge-overdue { background: #FEE2E2; color: #991B1B; }
.badge-low { background: #E0F2FE; color: #0369A1; }
.badge-medium { background: #FEF3C7; color: #92400E; }
.badge-high { background: #FFEDD5; color: #C2410C; }
.badge-paused { background: #F1F5F9; color: #475569; }

/* === ALERTS === */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* === PROGRESS === */
.progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 80px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s; }

/* === DETAIL ROWS === */
.detail-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-row:last-child { border-bottom: none; }
.detail-row > span:first-child { color: var(--text-muted); min-width: 120px; }

/* === ACTIVITY === */
.activity-list { display: flex; flex-direction: column; gap: 16px; }
.activity-item { display: flex; gap: 12px; align-items: flex-start; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.activity-content { display: flex; flex-direction: column; }
.activity-action { font-weight: 500; }
.activity-desc { color: var(--text-muted); font-size: 13px; }
.activity-time { color: var(--text-muted); font-size: 12px; }

/* === TEAM === */
.team-member { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.member-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.member-info { display: flex; flex-direction: column; }
.member-name { font-weight: 500; }
.member-role { color: var(--text-muted); font-size: 13px; }

/* === PROJECT CARD === */
.project-card { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.project-card:last-child { border-bottom: none; }
.project-card a { text-decoration: none; color: var(--text); }
.project-card a:hover { color: var(--accent); }

/* === FILE ITEM === */
.file-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.file-item a { color: var(--accent); text-decoration: none; }

/* === MEDIA GRID === */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.media-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.media-item img { width: 100%; height: 120px; object-fit: cover; }
.media-file-icon { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--text-muted); }
.media-name { display: block; padding: 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* === PAGINATION === */
.pagination { display: flex; gap: 4px; padding: 16px; justify-content: center; }
.page-link { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: 13px; }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === GRID === */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* === ERROR PAGE === */
.error-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.error-page h1 { font-size: 96px; color: var(--accent); }
.error-page p { font-size: 20px; color: var(--text-muted); margin: 16px 0 32px; }

/* === UTILITIES === */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
hr { border: none; border-top: 1px solid var(--border); }
.actions { display: flex; gap: 8px; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: block; }
    .main-content { margin-left: 0; padding: 16px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr; }
    .table th, .table td { padding: 8px 10px; font-size: 12px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; margin: 16px; }
}
