/* ATİS — Shared Styles */
/* v=20260425a */

/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
    --af-primary: #1e3a5f;
    --af-primary-dark: #142942;
    --af-primary-light: #2a5080;
    --af-accent: #0d9488;
    --af-accent-light: #14b8a6;
    --af-bg: #f1f5f9;
    --af-card: #ffffff;
    --af-text: #1e293b;
    --af-text-light: #64748b;
    --af-border: #e2e8f0;
    --af-success: #16a34a;
    --af-warning: #d97706;
    --af-danger: #dc2626;
    --af-radius: 10px;
    --af-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --af-shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --af-nav-width: 220px;
    --af-header-h: 56px;
}

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--af-bg);
    color: var(--af-text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; font-size: 16px; /* iOS zoom fix */ }
a { color: var(--af-primary); text-decoration: none; }
img { max-width: 100%; }

/* ============================================================
   HEADER
   ============================================================ */
.af-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    height: var(--af-header-h);
    background: var(--af-primary-dark);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    color: #fff;
}
.af-header-left { display: flex; align-items: center; gap: 12px; }
.af-header-right { display: flex; align-items: center; gap: 12px; }
.af-logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; letter-spacing: 0.5px; }
.af-logo svg { color: var(--af-accent-light); }
.af-user-info { text-align: right; display: none; }
.af-user-name { display: block; font-size: 13px; font-weight: 600; }
.af-user-role { display: block; font-size: 11px; opacity: 0.7; }
.af-logout-btn {
    background: rgba(255,255,255,0.1); border: none; color: #fff;
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.af-logout-btn:hover { background: rgba(255,255,255,0.2); }
.af-menu-toggle {
    background: none; border: none; color: #fff; cursor: pointer;
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.af-nav {
    position: fixed; top: var(--af-header-h); left: 0; bottom: 0;
    width: var(--af-nav-width); z-index: 35;
    background: var(--af-primary);
    padding: 8px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
}
.af-nav.open { transform: translateX(0); }
.af-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: 8px; color: rgba(255,255,255,0.75);
    font-size: 14px; font-weight: 500;
    transition: all 0.15s;
    min-height: 44px; /* touch target */
}
.af-nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.af-nav-item.active { background: rgba(255,255,255,0.15); color: #fff; }
.af-nav-item svg { flex-shrink: 0; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.af-main {
    margin-top: var(--af-header-h);
    padding: 16px;
    min-height: calc(100vh - var(--af-header-h));
}
.af-page-title {
    font-size: 22px; font-weight: 700; color: var(--af-text);
    margin-bottom: 16px;
}
.af-page-subtitle {
    font-size: 14px; color: var(--af-text-light);
    margin-top: -12px; margin-bottom: 16px;
}

/* ============================================================
   CARDS
   ============================================================ */
.af-card {
    background: var(--af-card);
    border-radius: var(--af-radius);
    box-shadow: var(--af-shadow);
    padding: 16px;
    margin-bottom: 12px;
}
.af-card-title {
    font-size: 15px; font-weight: 700; color: var(--af-text);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 8px;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.af-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.af-stat {
    background: var(--af-card);
    border-radius: var(--af-radius);
    box-shadow: var(--af-shadow);
    padding: 14px;
    text-align: center;
}
.af-stat-value {
    font-size: 28px; font-weight: 800;
    color: var(--af-primary);
    line-height: 1.1;
}
.af-stat-label {
    font-size: 12px; color: var(--af-text-light);
    margin-top: 4px; font-weight: 500;
}

/* ============================================================
   FORMS
   ============================================================ */
.af-field { margin-bottom: 14px; }
.af-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--af-text); margin-bottom: 5px;
}
.af-input, .af-select, .af-textarea {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--af-border);
    border-radius: 8px; background: #fff;
    font-size: 16px; color: var(--af-text);
    transition: border-color 0.15s;
    -webkit-appearance: none;
}
.af-input:focus, .af-select:focus, .af-textarea:focus {
    outline: none;
    border-color: var(--af-primary);
    box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}
.af-textarea { resize: vertical; min-height: 80px; }
.af-select { cursor: pointer; padding-right: 32px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.af-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    min-height: 44px; /* touch target */
    transition: all 0.15s;
}
.af-btn-primary { background: var(--af-primary); color: #fff; }
.af-btn-primary:hover { background: var(--af-primary-light); }
.af-btn-accent { background: var(--af-accent); color: #fff; }
.af-btn-accent:hover { background: var(--af-accent-light); }
.af-btn-outline { background: transparent; color: var(--af-primary); border: 1.5px solid var(--af-border); }
.af-btn-outline:hover { border-color: var(--af-primary); background: rgba(30,58,95,0.04); }
.af-btn-danger { background: var(--af-danger); color: #fff; }
.af-btn-danger:hover { background: #b91c1c; }
.af-btn-sm { padding: 6px 12px; font-size: 13px; min-height: 34px; }
.af-btn-block { width: 100%; }
.af-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   STATUS INDICATORS
   ============================================================ */
.af-status-done { color: var(--af-success); }
.af-status-not-done { color: var(--af-danger); }
.af-status-pending { color: var(--af-warning); }

.af-badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 20px; font-size: 11px; font-weight: 600;
}
.af-badge-info { background: #dbeafe; color: #1e40af; }
.af-badge-success { background: #dcfce7; color: #166534; }
.af-badge-warning { background: #fef3c7; color: #92400e; }
.af-badge-danger { background: #fee2e2; color: #991b1b; }

/* ============================================================
   TABLE
   ============================================================ */
.af-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.af-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.af-table th {
    text-align: left; padding: 10px 12px;
    background: var(--af-bg); font-weight: 600;
    color: var(--af-text-light); font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px;
    border-bottom: 2px solid var(--af-border);
    white-space: nowrap;
}
.af-table td {
    padding: 10px 12px; border-bottom: 1px solid var(--af-border);
    vertical-align: top;
}
.af-table tr:hover { background: rgba(30,58,95,0.02); }

/* ============================================================
   ENTRY CARD (shift log)
   ============================================================ */
.af-entry {
    background: var(--af-card);
    border-radius: var(--af-radius);
    box-shadow: var(--af-shadow);
    padding: 14px;
    margin-bottom: 10px;
    border-left: 4px solid var(--af-border);
}
.af-entry.done { border-left-color: var(--af-success); }
.af-entry.not-done { border-left-color: var(--af-danger); }
.af-entry.pending { border-left-color: var(--af-warning); }
.af-entry-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px; flex-wrap: wrap;
}
.af-entry-loc {
    font-size: 13px; font-weight: 700; color: var(--af-primary);
}
.af-entry-cat {
    font-size: 12px; color: var(--af-text-light);
    background: var(--af-bg); padding: 1px 6px; border-radius: 4px;
}
.af-entry-desc {
    font-size: 14px; color: var(--af-text); line-height: 1.5;
}
.af-entry-meta {
    display: flex; gap: 12px; margin-top: 8px;
    font-size: 12px; color: var(--af-text-light); flex-wrap: wrap;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.af-login-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--af-primary-dark) 0%, var(--af-primary) 50%, var(--af-primary-light) 100%);
    padding: 20px;
}
.af-login-card {
    background: #fff; border-radius: 16px;
    padding: 36px 28px; width: 100%; max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.af-login-logo {
    text-align: center; margin-bottom: 28px;
}
.af-login-logo svg { color: var(--af-primary); margin-bottom: 8px; }
.af-login-logo h1 {
    font-size: 24px; font-weight: 800; color: var(--af-primary);
    letter-spacing: 1px;
}
.af-login-logo p {
    font-size: 13px; color: var(--af-text-light); margin-top: 4px;
}
.af-login-error {
    background: #fee2e2; color: #991b1b;
    padding: 10px 14px; border-radius: 8px;
    font-size: 13px; margin-bottom: 14px;
    display: none;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.af-empty {
    text-align: center; padding: 40px 20px;
    color: var(--af-text-light);
}
.af-empty svg { margin-bottom: 12px; opacity: 0.3; }
.af-empty p { font-size: 14px; }

/* ============================================================
   LOADING
   ============================================================ */
.af-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
}
.af-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--af-border);
    border-top-color: var(--af-primary);
    border-radius: 50%;
    animation: af-spin 0.7s linear infinite;
}
@keyframes af-spin { to { transform: rotate(360deg); } }

/* ============================================================
   MODAL
   ============================================================ */
.af-modal-overlay {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.5);
    display: flex; align-items: flex-end; justify-content: center;
}
.af-modal {
    background: #fff; border-radius: 16px 16px 0 0;
    width: 100%; max-width: 500px; max-height: 90vh;
    overflow-y: auto; padding: 20px;
    animation: af-slide-up 0.25s ease;
}
.af-modal-title {
    font-size: 18px; font-weight: 700;
    margin-bottom: 16px;
    display: flex; align-items: center; justify-content: space-between;
}
.af-modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--af-text-light); font-size: 24px; line-height: 1;
}
@keyframes af-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE — 768px+
   ============================================================ */
@media (min-width: 768px) {
    .af-user-info { display: block; }
    .af-menu-toggle { display: none; }
    .af-nav {
        transform: translateX(0);
    }
    .af-main {
        margin-left: var(--af-nav-width);
        padding: 20px 24px;
    }
    .af-stats-grid { grid-template-columns: repeat(4, 1fr); }
    .af-modal-overlay { align-items: center; }
    .af-modal { border-radius: 16px; max-height: 80vh; }
    .af-page-title { font-size: 26px; }
}

/* ============================================================
   RESPONSIVE — 1024px+
   ============================================================ */
@media (min-width: 1024px) {
    .af-main { padding: 24px 32px; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.af-flex { display: flex; }
.af-flex-between { display: flex; justify-content: space-between; align-items: center; }
.af-gap-2 { gap: 8px; }
.af-gap-3 { gap: 12px; }
.af-mt-2 { margin-top: 8px; }
.af-mt-4 { margin-top: 16px; }
.af-mb-2 { margin-bottom: 8px; }
.af-mb-4 { margin-bottom: 16px; }
.af-text-sm { font-size: 13px; }
.af-text-light { color: var(--af-text-light); }
.af-text-center { text-align: center; }
.af-hidden { display: none !important; }
