/* DAMERAX Internal Portal - Main Stylesheet */
/* Fonts: Oswald (brand), DM Sans (body) */

:root {
    --black: #000000;
    --orange: #FF6600;
    --orange-light: #fff3eb;
    --white: #FFFFFF;
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #6C757D;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    --green: #28a745;
    --green-light: #d4edda;
    --red: #dc3545;
    --red-light: #f8d7da;
    --yellow: #ffc107;
    --yellow-light: #fff3cd;
    --blue: #007bff;
    --blue-light: #cce5ff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

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

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

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    min-height: 100vh;
    line-height: 1.6;
}

/* ── NAVBAR ── */
.navbar {
    background: var(--white);
    border-bottom: 3px solid var(--orange);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.brand-link { text-decoration: none; display: flex; flex-direction: column; }
.brand-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--black);
    letter-spacing: 2px;
    line-height: 1;
}
.brand-tagline {
    font-family: 'Oswald', sans-serif;
    font-size: 9px;
    color: var(--orange);
    letter-spacing: 1.5px;
    font-weight: 600;
    line-height: 1;
    margin-top: 2px;
}

.nav-menu { display: flex; align-items: center; gap: 4px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-link:hover { background: var(--gray-100); color: var(--black); }
.nav-link.active { background: var(--orange); color: var(--white); }
.nav-admin { color: var(--orange); font-weight: 600; }
.nav-admin:hover { background: var(--orange-light); }
.nav-admin.active { background: var(--orange); color: var(--white); }
.nav-logout { color: var(--red); }
.nav-logout:hover { background: var(--red-light); color: var(--red); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gray-800); border-radius: 2px; transition: var(--transition); }

/* ── MAIN CONTENT ── */
.main-content { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.page-header-bar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--orange);
}
.emp-greeting { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.emp-code { background: var(--gray-100); color: var(--gray-600); padding: 2px 8px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.badge-admin { background: var(--orange); color: var(--white); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; font-family: 'Oswald', sans-serif; }
.current-time { font-family: 'Oswald', sans-serif; font-size: 18px; color: var(--gray-600); }

/* ── PAGE TITLES ── */
.page-title {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--black);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.page-subtitle { color: var(--gray-600); font-size: 14px; margin-bottom: 24px; }

/* ── CARDS ── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}
.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--black);
    letter-spacing: 0.5px;
}
.card-body { padding: 24px; }

/* ── GRID ── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ── STAT CARDS ── */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--orange);
}
.stat-card.green::before { background: var(--green); }
.stat-card.red::before   { background: var(--red); }
.stat-card.blue::before  { background: var(--blue); }

.stat-label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.stat-value { font-family: 'Oswald', sans-serif; font-size: 36px; font-weight: 700; color: var(--black); line-height: 1; }
.stat-unit  { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; letter-spacing: 0.3px; }
.form-label .required { color: var(--red); margin-left: 2px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    background: var(--white);
    color: var(--gray-900);
    transition: var(--transition);
    appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,102,0,0.12);
}
.form-control::placeholder { color: var(--gray-400); }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--orange); color: var(--white); border-color: var(--orange); }
.btn-primary:hover:not(:disabled) { background: #e55a00; border-color: #e55a00; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,102,0,0.3); }
.btn-black   { background: var(--black); color: var(--white); border-color: var(--black); }
.btn-black:hover:not(:disabled) { background: var(--gray-800); border-color: var(--gray-800); transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover:not(:disabled) { background: var(--gray-100); border-color: var(--gray-400); }
.btn-danger  { background: var(--red); color: var(--white); border-color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #c82333; }
.btn-success { background: var(--green); color: var(--white); border-color: var(--green); }
.btn-success:hover:not(:disabled) { background: #218838; }
.btn-sm  { padding: 6px 12px; font-size: 13px; }
.btn-lg  { padding: 14px 28px; font-size: 16px; }
.btn-full { width: 100%; }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: var(--gray-50); }
th { padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid var(--gray-200); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-800); vertical-align: middle; }
tr:hover td { background: var(--gray-50); }
tr:last-child td { border-bottom: none; }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.badge-success  { background: var(--green-light);  color: var(--green); }
.badge-danger   { background: var(--red-light);    color: var(--red); }
.badge-warning  { background: var(--yellow-light); color: #856404; }
.badge-info     { background: var(--blue-light);   color: var(--blue); }
.badge-secondary{ background: var(--gray-200);     color: var(--gray-600); }
.badge-orange   { background: var(--orange-light); color: var(--orange); }

/* ── ALERTS ── */
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; font-weight: 500; display: flex; align-items: flex-start; gap: 10px; border-left: 4px solid; }
.alert-success { background: var(--green-light);  border-color: var(--green);  color: #155724; }
.alert-danger   { background: var(--red-light);   border-color: var(--red);   color: #721c24; }
.alert-warning  { background: var(--yellow-light); border-color: var(--yellow); color: #856404; }
.alert-info     { background: var(--blue-light);  border-color: var(--blue);  color: #004085; }

.flash-msg { border-radius: var(--radius); margin-bottom: 20px; }

/* ── PROGRESS BAR ── */
.progress { background: var(--gray-200); border-radius: 20px; height: 10px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; background: var(--orange); border-radius: 20px; transition: width 0.6s ease; }
.progress-bar.green { background: var(--green); }

/* ── ATTENDANCE CALENDAR ── */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.cal-day-name { text-align: center; font-size: 11px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; padding: 6px 0; }
.cal-day {
    aspect-ratio: 1;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    position: relative;
}
.cal-day.today { border-color: var(--orange); color: var(--orange); font-weight: 700; }
.cal-day.present { background: var(--green-light); border-color: var(--green); color: var(--green); }
.cal-day.absent  { background: var(--red-light); border-color: var(--red); color: var(--red); }
.cal-day.late    { background: var(--yellow-light); border-color: var(--yellow); color: #856404; }
.cal-day.half    { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.cal-day.empty   { background: transparent; border-color: transparent; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 2px; }
.cal-dot.present { background: var(--green); }
.cal-dot.absent  { background: var(--red); }
.cal-dot.late    { background: var(--yellow); }
.cal-dot.half    { background: var(--blue); }

/* ── CHECKIN PANEL ── */
.checkin-panel {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}
.checkin-time {
    font-family: 'Oswald', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: var(--black);
    letter-spacing: 2px;
    line-height: 1;
    margin: 16px 0 8px;
}
.checkin-date { color: var(--gray-500); font-size: 15px; margin-bottom: 28px; }
.checkin-btn-wrap { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── UPLOAD CARD ── */
.upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}
.upload-zone:hover { border-color: var(--orange); background: var(--orange-light); }
.upload-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-label { font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.upload-hint  { font-size: 13px; color: var(--gray-400); }

/* ── DOC STATUS ITEMS ── */
.doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--white);
}
.doc-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; background: var(--gray-100); }
.doc-info { flex: 1; min-width: 0; }
.doc-name  { font-weight: 600; font-size: 15px; color: var(--black); }
.doc-sub   { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

/* ── LOGIN PAGE ── */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    padding: 20px;
}
.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}
.login-header {
    background: var(--black);
    padding: 36px 40px 28px;
    text-align: center;
}
.login-logo  { font-family: 'Oswald', sans-serif; font-size: 32px; font-weight: 700; color: var(--white); letter-spacing: 3px; }
.login-tag   { font-family: 'Oswald', sans-serif; font-size: 11px; color: var(--orange); letter-spacing: 2px; margin-top: 4px; }
.login-body  { padding: 32px 40px 40px; }
.login-title { font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 600; color: var(--black); margin-bottom: 24px; }

/* ── TABS ── */
.tab-nav { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; gap: 0; overflow-x: auto; }
.tab-btn {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: var(--transition);
    font-family: 'DM Sans', sans-serif;
}
.tab-btn:hover  { color: var(--black); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── SECTION TITLE ── */
.section-title { font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 600; color: var(--black); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

/* ── MISC UTILITIES ── */
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }  .mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; } .mt-5 { margin-top: 32px; } .mb-4 { margin-bottom: 24px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-muted { color: var(--gray-500); font-size: 13px; }
.text-orange { color: var(--orange); }
.d-flex  { display: flex; } .align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 16px; } .flex-wrap { flex-wrap: wrap; }
.fw-bold { font-weight: 700; }
.font-oswald { font-family: 'Oswald', sans-serif; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-500); }
.empty-state svg { opacity: 0.3; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 64px; left: 0; right: 0;
        background: var(--white);
        padding: 16px;
        border-bottom: 1px solid var(--gray-200);
        box-shadow: var(--shadow-md);
        z-index: 999;
        gap: 4px;
    }
    .nav-menu.open { display: flex; }
    .nav-toggle { display: flex; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .page-header-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .checkin-time { font-size: 40px; }
    .main-content { padding: 16px 12px 40px; }
    .login-body, .login-header { padding-left: 24px; padding-right: 24px; }
    .checkin-btn-wrap .btn-lg { flex: 1; }
}

@media (max-width: 480px) {
    .cal-day { font-size: 11px; }
    .card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}
