/* ============================================================
   OMNIT FIELD — Main Stylesheet
   ============================================================ */

:root {
    --blue:       #0872BA;
    --blue-light: #6ECDDD;
    --gray:       #818285;
    --navy:       #0A1F3D;
    --white:      #FFFFFF;
    --bg:         #F4F6F9;
    --danger:     #C0392B;
    --success:    #1E5631;
    --warning:    #E67E22;
    --font:       'Barlow Condensed', sans-serif;
    --radius:     8px;
    --shadow:     0 2px 8px rgba(10,31,61,0.08);
    --sidebar-w:  240px;
    --topbar-h:   56px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--navy); line-height: 1.5; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- LOGIN ---- */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; background: var(--navy);
}
.login-card {
    background: var(--white); padding: 40px 32px; border-radius: var(--radius);
    width: 100%; max-width: 400px; box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 32px; }

/* ---- LOGO ---- */
.logo {
    font-size: 28px; font-weight: 700; color: var(--blue);
    letter-spacing: 6px; display: block;
}
.logo-sub {
    font-size: 12px; color: var(--blue-light); letter-spacing: 4px;
    font-weight: 500;
}

/* ---- SIDEBAR ---- */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w); background: var(--navy);
    z-index: 100; transition: transform 0.3s ease;
    overflow-y: auto;
}
.sidebar-header {
    padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header .logo { font-size: 24px; }
.sidebar-nav { list-style: none; padding: 12px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 24px; color: rgba(255,255,255,0.7);
    font-size: 15px; font-weight: 500; transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--white); background: rgba(255,255,255,0.08);
    text-decoration: none;
}
.sidebar-nav a.active { border-left: 3px solid var(--blue-light); }
.nav-icon { font-size: 18px; width: 24px; text-align: center; }
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-left: var(--sidebar-w); min-height: 100vh;
    display: flex; flex-direction: column;
}

/* ---- TOPBAR ---- */
.topbar {
    height: var(--topbar-h); background: var(--white);
    border-bottom: 1px solid #E0E0E0; display: flex;
    align-items: center; padding: 0 24px; gap: 16px;
    position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: var(--gray); font-size: 14px; }
.hamburger {
    display: none; background: none; border: none;
    font-size: 24px; cursor: pointer; color: var(--navy);
}

/* ---- CONTENT ---- */
.content { padding: 24px; flex: 1; max-width: 1200px; width: 100%; }
.app-footer {
    padding: 16px 24px; text-align: center; color: var(--gray);
    font-size: 12px; border-top: 1px solid #E0E0E0;
}

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--white); border-radius: var(--radius);
    padding: 24px; text-align: center; box-shadow: var(--shadow);
}
.stat-number { font-size: 36px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 14px; color: var(--gray); font-weight: 500; margin-top: 4px; }

/* ---- CARDS ---- */
.card {
    background: var(--white); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.card-warning { border-left: 4px solid var(--warning); }
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: var(--navy); }
.card-header-flex { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header-flex .card-title { margin-bottom: 0; }

/* ---- TABLES ---- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    background: var(--navy); color: var(--white);
    padding: 10px 12px; text-align: left; font-weight: 600;
    font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}
.table td { padding: 10px 12px; border-bottom: 1px solid #EEE; font-size: 14px; }
.table tbody tr:nth-child(even) td { background: var(--bg); }
.table tbody tr:hover td { background: #E8F4FD; }
.clickable-row { cursor: pointer; }
.td-actions { white-space: nowrap; }

/* ---- BADGES ---- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { background: #D5E8D4; color: var(--success); }
.badge-danger  { background: #FADBD8; color: var(--danger); }
.badge-warning { background: #FDEBD0; color: #935116; }
.badge-muted   { background: #E0E0E0; color: #555; }
.badge-info    { background: #D6EFF8; color: var(--blue); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--navy); margin-bottom: 4px; text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #CCC;
    border-radius: 6px; font-family: var(--font); font-size: 15px;
    color: var(--navy); background: var(--white); transition: border 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,114,186,0.12);
}
.form-group textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border: none; border-radius: 6px;
    font-family: var(--font); font-size: 15px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all 0.2s;
    gap: 6px;
}
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-secondary { background: #E0E0E0; color: var(--navy); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }

/* ---- SEARCH ---- */
.input-search {
    width: 100%; max-width: 320px; padding: 10px 12px;
    border: 1px solid #CCC; border-radius: 6px;
    font-family: var(--font); font-size: 15px;
}
.input-search:focus { outline: none; border-color: var(--blue); }

/* ---- PAGE ACTIONS ---- */
.page-actions {
    display: flex; gap: 12px; align-items: center;
    flex-wrap: wrap; margin-bottom: 20px;
}
.quick-actions { display: flex; gap: 12px; margin-bottom: 24px; }

/* ---- FILTER ---- */
.filter-bar { margin-bottom: 12px; }
.filter-bar select {
    padding: 8px 12px; border: 1px solid #CCC; border-radius: 6px;
    font-family: var(--font); font-size: 14px;
}

/* ---- DETAIL GRID ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.detail-item { }
.detail-full { grid-column: 1 / -1; }
.detail-label { display: block; font-size: 11px; font-weight: 600; color: var(--gray); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 15px; }

/* ---- CHECKLIST ---- */
.checklist { display: flex; flex-direction: column; gap: 4px; }
.checklist-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 6px; cursor: pointer;
    transition: background 0.15s;
}
.checklist-item:hover { background: var(--bg); }
.checklist-item.completed .checklist-text { text-decoration: line-through; color: var(--gray); }
.checklist-item input[type=checkbox] {
    width: 20px; height: 20px; accent-color: var(--success); cursor: pointer; flex-shrink: 0;
}
.checklist-text { flex: 1; font-size: 15px; }
.checklist-time { font-size: 12px; color: var(--gray); white-space: nowrap; }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 200; padding: 20px;
}
.modal-card {
    background: var(--white); border-radius: var(--radius);
    padding: 24px; max-width: 400px; width: 100%; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal-card h3 { margin-bottom: 16px; }

/* ---- TOAST ---- */
.toast-container {
    position: fixed; bottom: 24px; right: 24px; z-index: 300;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    padding: 12px 20px; border-radius: 6px; color: var(--white);
    font-weight: 500; font-size: 14px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toastIn 0.3s ease;
    max-width: 360px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---- ALERTS ---- */
.alert {
    padding: 12px 16px; border-radius: 6px; margin-bottom: 16px;
    font-size: 14px; font-weight: 500;
}
.alert-danger { background: #FADBD8; color: var(--danger); }

/* ---- UTILITIES ---- */
.text-muted { color: var(--gray); font-size: 13px; }
.text-danger { color: var(--danger); font-weight: 600; }
code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* ============================================================
   RESPONSIVE — Mobile first
   ============================================================ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.active { display: block; }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
    .content { padding: 16px; }

    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-actions { flex-direction: column; align-items: stretch; }
    .quick-actions { flex-direction: column; }

    .table th, .table td { padding: 8px 8px; font-size: 13px; }

    .topbar-user { display: none; }
    .toast-container { bottom: 16px; right: 16px; left: 16px; }
    .toast { max-width: 100%; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 16px; }
    .stat-number { font-size: 28px; }
}
