:root {
    --green-dark:  #2a6e2a;
    --green-mid:   #4cae4c;
    --green-light: #5cb85c;
    --green-pale:  #e8f5e9;
    --black:       #0d0d0d;
    --dark:        #1a1a1a;
    --gray:        #555555;
    --light-gray:  #f5f5f5;
    --white:       #ffffff;
    --border:      #dddddd;
    --status-submitted:   #1565c0;
    --status-received:    #6a1b9a;
    --status-diagnosing:  #e65100;
    --status-inrepair:    #f57f17;
    --status-qc:          #558b2f;
    --status-readyship:   #00695c;
    --status-shipped:     #37474f;
    --status-completed:   #1b5e20;
    --status-onhold:      #b71c1c;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    color: var(--dark);
    margin: 0;
    background: var(--white);
}

a { color: var(--green-mid); text-decoration: none; }
a:hover { color: var(--green-dark); }

/* ── NAVBAR ── */
.ess-nav {
    background: var(--black);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.ess-nav .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.ess-nav .brand span { color: var(--green-light); }
.nav-btn {
    background: var(--green-mid);
    color: var(--white) !important;
    padding: 10px 22px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-block;
}
.nav-btn:hover { background: var(--green-dark); color: var(--white) !important; }
.nav-btn.outline {
    background: transparent;
    border: 2px solid var(--green-light);
    color: var(--green-light) !important;
    margin-right: 10px;
}
.nav-btn.outline:hover { background: var(--green-mid); border-color: var(--green-mid); color: var(--white) !important; }

/* ── HERO ── */
.hero {
    background: linear-gradient(135deg, var(--black) 0%, #0a2a0a 60%, var(--green-dark) 100%);
    color: var(--white);
    padding: 90px 2rem 80px;
    text-align: center;
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.hero h1 span { color: var(--green-light); }
.hero p {
    font-size: 1.2rem;
    color: #cccccc;
    max-width: 700px;
    margin: 0 auto 2rem;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn-hero-primary {
    background: var(--green-mid);
    color: var(--white);
    padding: 14px 36px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.btn-hero-primary:hover { background: var(--green-dark); color: var(--white); }
.btn-hero-outline {
    background: transparent;
    color: var(--white);
    padding: 14px 36px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn-hero-outline:hover { border-color: var(--white); color: var(--white); }

/* ── BADGE STRIP ── */
.badge-strip {
    background: var(--green-dark);
    color: var(--white);
    padding: 12px 2rem;
    text-align: center;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}
.badge-strip span { display: flex; align-items: center; gap: 6px; }

/* ── SECTION TITLES ── */
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 0.5rem;
}
.section-title p { color: var(--gray); font-size: 1.05rem; }
.section-title .underline {
    width: 60px;
    height: 4px;
    background: var(--green-mid);
    margin: 0.75rem auto 0;
    border-radius: 2px;
}

/* ── DEVICES SECTION ── */
.devices-section { padding: 70px 2rem; background: var(--light-gray); }
.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
    max-width: 1100px;
    margin: 0 auto;
}
.device-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}
.device-card:hover {
    border-color: var(--green-mid);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(45,138,45,0.15);
}
.device-card .icon { font-size: 2.4rem; margin-bottom: 0.75rem; }
.device-card .name { font-weight: 600; font-size: 0.9rem; color: var(--dark); line-height: 1.3; }
.device-card .brand { font-size: 0.78rem; color: var(--gray); margin-top: 3px; }

/* ── HOW IT WORKS ── */
.how-section { padding: 70px 2rem; background: var(--white); }
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}
.step {
    text-align: center;
    padding: 1.5rem;
}
.step-num {
    width: 56px;
    height: 56px;
    background: var(--green-mid);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}
.step h3 { font-size: 1.1rem; font-weight: 700; color: var(--green-dark); margin-bottom: 0.5rem; }
.step p { font-size: 0.95rem; color: var(--gray); line-height: 1.5; }

/* ── WHY ESS ── */
.why-section { padding: 70px 2rem; background: var(--black); color: var(--white); }
.why-section .section-title h2 { color: var(--green-light); }
.why-section .section-title p { color: #aaaaaa; }
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
}
.why-card {
    background: #1a1a1a;
    border-left: 4px solid var(--green-mid);
    border-radius: 4px;
    padding: 1.25rem 1.5rem;
}
.why-card h4 { color: var(--green-light); font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; }
.why-card p { color: #aaaaaa; font-size: 0.9rem; line-height: 1.5; margin: 0; }

/* ── CTA SECTION ── */
.cta-section {
    background: var(--green-dark);
    color: var(--white);
    padding: 60px 2rem;
    text-align: center;
}
.cta-section h2 { font-size: 1.9rem; font-weight: 700; margin-bottom: 0.75rem; }
.cta-section p { font-size: 1.05rem; color: rgba(255,255,255,0.85); margin-bottom: 2rem; }
.btn-cta {
    background: var(--white);
    color: var(--green-dark);
    padding: 14px 40px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}
.btn-cta:hover { background: var(--green-pale); color: var(--green-dark); }

/* ── FOOTER ── */
footer {
    background: #0a0a0a;
    color: #888888;
    padding: 2rem;
    text-align: center;
    font-size: 0.88rem;
    line-height: 1.7;
}
footer strong { color: var(--white); }
footer a { color: var(--green-light); }

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--black) 0%, #0a2a0a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.login-logo {
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    letter-spacing: 1px;
    text-align: center;
}
.login-logo span { color: var(--green-light); }
.login-logo small { display: block; font-size: 0.85rem; color: #aaaaaa; font-weight: 400; margin-top: 4px; }
.login-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 860px;
}
.login-card {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.login-card h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 0.25rem;
}
.login-card .sub { color: var(--gray); font-size: 0.88rem; margin-bottom: 1.5rem; }
.login-card .divider { height: 2px; background: var(--green-pale); margin: 1.5rem 0; }
.login-back { color: rgba(255,255,255,0.6); font-size: 0.88rem; margin-top: 1.5rem; text-align: center; }
.login-back a { color: var(--green-light); }

/* ── FORMS ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--dark); margin-bottom: 4px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.95rem;
    color: var(--dark);
    background: var(--white);
    transition: border-color 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--green-mid);
    box-shadow: 0 0 0 3px rgba(45,138,45,0.12);
}
.form-group textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.btn-submit {
    width: 100%;
    padding: 12px;
    background: var(--green-mid);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.btn-submit:hover { background: var(--green-dark); }
.btn-submit.secondary {
    background: var(--gray);
}
.btn-submit.secondary:hover { background: #333333; }

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}
.alert-error { background: #ffebee; border-color: #c62828; color: #b71c1c; }
.alert-success { background: #e8f5e9; border-color: var(--green-mid); color: var(--green-dark); }
.alert-info { background: #e3f2fd; border-color: #1565c0; color: #0d47a1; }

/* ── PORTAL / DASHBOARD ── */
.dash-layout { display: flex; min-height: 100vh; }
.dash-sidebar {
    width: 240px;
    background: var(--black);
    flex-shrink: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    background: #050505;
    color: var(--white);
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid #222;
}
.sidebar-brand span { color: var(--green-light); }
.sidebar-brand small { display: block; font-size: 0.75rem; color: #888; font-weight: 400; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 1rem 0; }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 1.5rem;
    color: #aaaaaa;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
    color: var(--white);
    background: rgba(45,138,45,0.15);
    border-left-color: var(--green-light);
}
.sidebar-nav .nav-section {
    padding: 1rem 1.5rem 0.3rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
    font-weight: 600;
}
.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #222;
}
.sidebar-footer a { color: #777; font-size: 0.85rem; }
.sidebar-footer a:hover { color: var(--white); }
.dash-main { flex: 1; background: #f4f6f4; display: flex; flex-direction: column; }
.dash-header {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dash-header h1 { font-size: 1.3rem; font-weight: 700; color: var(--green-dark); margin: 0; }
.dash-content { padding: 2rem; flex: 1; }

/* ── STAT CARDS ── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.25rem;
    border-left: 4px solid var(--green-mid);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--green-dark); }
.stat-card .lbl { font-size: 0.82rem; color: var(--gray); margin-top: 2px; }

/* ── DATA TABLE ── */
.data-table-wrap {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    overflow: hidden;
}
.data-table-wrap .table-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.data-table-wrap .table-header h3 { font-size: 1rem; font-weight: 700; color: var(--dark); margin: 0; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}
.data-table th {
    background: var(--light-gray);
    padding: 10px 1rem;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 1rem;
    border-bottom: 1px solid #f0f0f0;
    color: var(--dark);
    vertical-align: middle;
}
.data-table tr:hover td { background: #fafff9; }
.data-table tr:last-child td { border-bottom: none; }
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* ── STATUS BADGES ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge-submitted   { background:#e3f2fd; color:#1565c0; }
.badge-received    { background:#f3e5f5; color:#6a1b9a; }
.badge-diagnosing  { background:#fff3e0; color:#e65100; }
.badge-inrepair    { background:#fff8e1; color:#f57f17; }
.badge-qc          { background:#f1f8e9; color:#558b2f; }
.badge-readyship   { background:#e0f2f1; color:#00695c; }
.badge-shipped     { background:#eceff1; color:#37474f; }
.badge-completed   { background:#e8f5e9; color:#1b5e20; }
.badge-onhold      { background:#ffebee; color:#b71c1c; }
.badge-pending     { background:#fff8e1; color:#f57f17; }
.badge-approved    { background:#e8f5e9; color:#1b5e20; }
.badge-denied      { background:#ffebee; color:#b71c1c; }

/* ── TICKET DETAIL ── */
.ticket-card {
    background: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}
.ticket-card h3 { font-size: 1rem; font-weight: 700; color: var(--green-dark); margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.75rem; }
.ticket-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.meta-item label { display: block; font-size: 0.75rem; color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.meta-item span { font-size: 0.92rem; color: var(--dark); }

/* ── TIMELINE ── */
.timeline { padding: 0; list-style: none; margin: 0; }
.timeline li {
    padding: 0.75rem 0 0.75rem 2rem;
    position: relative;
    border-left: 2px solid var(--border);
    font-size: 0.88rem;
    color: var(--gray);
}
.timeline li::before {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--green-mid);
    border-radius: 50%;
    position: absolute;
    left: -6px;
    top: 1rem;
}
.timeline li .tl-time { font-size: 0.78rem; color: #aaa; }
.timeline li .tl-text { color: var(--dark); }

/* ── BUTTONS ── */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 4px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-green { background: var(--green-mid); color: var(--white); }
.btn-green:hover { background: var(--green-dark); color: var(--white); }
.btn-dark { background: var(--dark); color: var(--white); }
.btn-dark:hover { background: #333; color: var(--white); }
.btn-red { background: #c62828; color: var(--white); }
.btn-red:hover { background: #b71c1c; color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--dark); }
.btn-outline:hover { background: var(--light-gray); color: var(--dark); }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .login-panels { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .dash-layout { flex-direction: column; }
    .dash-sidebar { width: 100%; }
    .badge-strip { gap: 1.5rem; }
}
