﻿/* ============================================================
   QLDA Thi Công Kết Cấu Thép - Main Stylesheet
   ASP.NET 4.0 Web Forms
   ============================================================ */

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

:root {
    --primary: #0066b2;
    --primary-light: #0080d4;
    --primary-dark: #004a80;
    --accent: #e67e22;
    --accent-light: #f39c12;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f1c40f;
    --info: #3498db;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --sidebar-w: 260px;
    --topbar-h: 56px;
    --font-base: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 2px 8px rgba(0,0,0,.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,.12);
}

html { font-size: 14px; }
body {
    font-family: var(--font-base);
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.55;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { color: var(--primary); text-decoration: underline; }

/* --- Layout Shell --- */
.layout-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    background: var(--primary-dark);
    color: #fff;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform .25s;
}
.sidebar-brand {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: rgba(0,0,0,.15);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .brand-icon { 
    width: 28px; height: 28px; 
    margin-right: 10px; 
    background: var(--accent); 
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 800;
}
.sidebar-nav { padding: 12px 0; }
.nav-section {
    padding: 8px 20px 4px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.4);
    margin-top: 6px;
}
.nav-item {
    display: block;
    padding: 9px 20px 9px 18px;
    color: rgba(255,255,255,.72);
    font-size: .92rem;
    border-left: 3px solid transparent;
    transition: all .15s;
    cursor: pointer;
}
.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,.08);
    color: #fff;
    border-left-color: var(--accent);
    text-decoration: none;
}
.nav-item .nav-icon { 
    display: inline-block; width: 22px; 
    text-align: center; margin-right: 8px;
    font-size: 1rem;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-width: 0;
}

/* Topbar */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 1.1rem; font-weight: 600; color: var(--gray-800); }
.breadcrumb-simple { font-size: .82rem; color: var(--gray-500); }
.breadcrumb-simple a { color: var(--gray-600); }

.user-info {
    display: flex; align-items: center; gap: 8px;
    font-size: .88rem; color: var(--gray-700);
}
.user-avatar {
    width: 32px; height: 32px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: .8rem; font-weight: 600;
}
.badge-notif {
    background: var(--danger);
    color: #fff;
    font-size: .7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

/* Page Content */
.page-body { padding: 20px 24px 40px; }

/* --- Components --- */

/* Cards */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}
.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}
.card-body { padding: 20px; }

/* Stat Cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 20px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
}
.stat-card .stat-label { font-size: .78rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--gray-800); margin-top: 2px; }
.stat-card .stat-sub { font-size: .82rem; color: var(--gray-600); margin-top: 4px; }
.stat-card.primary { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.warning { border-left: 4px solid var(--accent); }
.stat-card.danger { border-left: 4px solid var(--danger); }

/* Tables */
.tbl-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
table.data-table th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
table.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
table.data-table tr:hover td { background: var(--gray-50); }

/* ASP.NET GridView compatibility */
.gridview-wrap .GridViewStyle { width: 100%; border-collapse: collapse; }
.gridview-wrap .GridViewStyle th { 
    background: var(--gray-50); color: var(--gray-700); font-weight: 600;
    padding: 10px 14px; border-bottom: 2px solid var(--gray-200);
    text-align: left; font-size: .82rem;
}
.gridview-wrap .GridViewStyle td { 
    padding: 10px 14px; border-bottom: 1px solid var(--gray-100); 
}
.gridview-wrap .GridViewStyle tr:hover td { background: var(--gray-50); }
.gridview-wrap .GridViewPager td {
    padding: 10px 14px;
    border: none;
    text-align: center;
}
.gridview-wrap .GridViewPager a, .gridview-wrap .GridViewPager span {
    display: inline-block;
    padding: 4px 10px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: .82rem;
}
.gridview-wrap .GridViewPager span {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge-draft { background: #eee; color: var(--gray-600); }
.badge-active { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }
.badge-success { background: #d4edda; color: #155724; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 5px;
}
.form-group label .required { color: var(--danger); }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: .9rem;
    font-family: var(--font-base);
    color: var(--gray-800);
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,.15);
}
select.form-control { height: 38px; }
textarea.form-control { min-height: 80px; resize: vertical; }

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }

.form-inline { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: 4px;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-base);
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { text-decoration: none; opacity: .88; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { border-color: var(--gray-400); background: var(--gray-50); }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 10px 24px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-group { display: flex; gap: 8px; }

/* Action Links in tables */
.action-link { 
    font-size: .82rem; margin-right: 8px; 
    padding: 3px 8px; border-radius: 3px;
}
.action-link:hover { background: var(--gray-100); }

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: .9rem;
    border: 1px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }

/* Tabs */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    gap: 0;
}
.tab-nav a {
    padding: 10px 20px;
    font-size: .9rem;
    color: var(--gray-600);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}
.tab-nav a:hover { color: var(--primary); text-decoration: none; }
.tab-nav a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* Modal/Panel Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 60px;
}
.modal-overlay.show { display: flex; }
.modal-box {
    background: #fff;
    border-radius: var(--radius);
    width: 600px;
    max-width: 94vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray-500); padding: 4px 8px; }
.modal-body { padding: 20px; }
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Search/Filter bar */
.filter-bar {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-bar .form-control { max-width: 200px; }
.filter-bar label { font-size: .82rem; font-weight: 600; color: var(--gray-600); margin-right: 4px; }

/* Progress bar */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar .progress-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--primary-light);
    transition: width .3s;
}
.progress-bar .progress-fill.green { background: var(--success); }
.progress-bar .progress-fill.orange { background: var(--accent); }
.progress-bar .progress-fill.red { background: var(--danger); }

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
}
.login-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    width: 400px;
    max-width: 92vw;
    box-shadow: var(--shadow-lg);
}
.login-box h2 {
    text-align: center;
    color: var(--primary-dark);
    margin-bottom: 6px;
    font-size: 1.4rem;
}
.login-box .login-subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: .88rem;
    margin-bottom: 24px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state h4 { color: var(--gray-600); margin-bottom: 6px; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .form-row { flex-direction: column; gap: 0; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .form-control { max-width: none; }
}
