/* app/static/css/style.css */
:root {
    --bg-deep: #06080d; --bg: #0a0f1a; --bg-card: #0f1628; --bg-card-hover: #141d35;
    --border: #1a2540; --border-light: #243052;
    --gold: #c9a84c; --gold-light: #e8d48b; --gold-dim: rgba(201,168,76,0.15);
    --text: #94a3b8; --text-light: #cbd5e1; --heading: #f1f5f9;
    --green: #22c55e; --red: #ef4444; --blue: #3b82f6; --teal: #14b8a6; --orange: #f97316; --purple: #a855f7;
}

body.light {
    --bg-deep: #f5f7fa; --bg: #ffffff; --bg-card: #ffffff; --bg-card-hover: #f0f4f8;
    --border: #e2e8f0; --border-light: #cbd5e1;
    --gold: #b8922e; --gold-light: #a07d1e;
    --text: #475569; --text-light: #334155; --heading: #0f172a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Cairo', sans-serif; background: var(--bg-deep); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
body::before { content:''; position:fixed; inset:0; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"); pointer-events:none; z-index:9999; }
body.light::before { display: none; }

nav { background: rgba(6,8,13,0.92); backdrop-filter: blur(20px); border-bottom: 1px solid var(--border); padding: 0 2rem; position: sticky; top: 0; z-index: 100; }
body.light nav { background: rgba(255,255,255,0.95); }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; height: 64px; }
.logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; background: linear-gradient(135deg, var(--gold), var(--gold-light)); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-weight: 900; font-size: 1.1rem; color: var(--bg-deep); }
.logo-text { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--heading); }
.logo-text span { color: var(--gold); }
.tenant-name { font-size: 0.72rem; color: var(--gold); font-weight: 600; opacity: 0.8; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--text); text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: color 0.3s; }
.nav-links a:hover { color: var(--gold); }
.nav-active { color: var(--gold) !important; }

.btn-nav, .btn-nav-logout { background: transparent; border: 1px solid var(--border-light); color: var(--text-light); padding: 0.4rem 1.2rem; border-radius: 6px; font-weight: 700; font-size: 0.8rem; text-decoration: none; transition: all 0.3s; }
.btn-nav:hover, .btn-nav-logout:hover { border-color: var(--gold); color: var(--gold); }

.theme-toggle { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-light); width: 34px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; transition: all 0.3s; padding: 0; }
.theme-toggle:hover { border-color: var(--gold); color: var(--gold); }

main { flex: 1; max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem; width: 100%; }

.flash-msg, .alert { padding: 0.9rem 1.2rem; border-radius: 12px; font-size: 0.85rem; font-weight: 700; margin-bottom: 0.8rem; max-width: 900px; margin-left: auto; margin-right: auto; }
.flash-msg.error, .alert-red { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2); color: #fca5a5; }
.flash-msg.success { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.2); color: #86efac; }
.alert-yellow { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.2); color: #fde68a; }

footer { background: var(--bg-deep); border-top: 1px solid var(--border); padding: 1.5rem 2rem; text-align: center; }
.footer-brand { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.82rem; color: var(--text-light); }
.footer-brand span { color: var(--gold); }
.footer-copy { font-size: 0.72rem; color: #475569; margin-top: 0.3rem; }

/* Utilities */
.btn-submit { background: linear-gradient(135deg, var(--green), #16a34a); color: #fff; padding: 0.75rem 2rem; border-radius: 10px; font-weight: 800; font-size: 0.95rem; border: none; cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.3s; box-shadow: 0 4px 16px rgba(34,197,94,0.25); text-decoration: none; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(34,197,94,0.35); }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select {
    width: 100%; padding: 0.75rem 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--heading); font-family: 'Cairo', sans-serif; font-size: 0.9rem; outline: none; transition: border-color 0.3s;
}
input:focus, select:focus { border-color: var(--gold); }

.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; text-align: right; }
thead tr { background: var(--bg); }
th { padding: 0.8rem 1rem; font-size: 0.8rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); color: var(--heading); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; max-width: 1000px; margin: 0 auto; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 2rem 1.8rem; text-align: center; text-decoration: none; transition: all 0.4s; position: relative; overflow: hidden; }
.card:hover { border-color: rgba(201,168,76,0.3); transform: translateY(-4px); box-shadow: 0 16px 48px rgba(0,0,0,0.3); }

/* ===== MOBILE & TABLET RESPONSIVE ===== */

/* Hamburger menu toggle */
.nav-toggle { display:none; background:none; border:1px solid var(--border); color:var(--text-light); width:38px; height:38px; border-radius:8px; cursor:pointer; font-size:1.2rem; align-items:center; justify-content:center; transition:all 0.3s; }
.nav-toggle:hover { border-color:var(--gold); color:var(--gold); }

/* Tablet (<=900px) */
@media(max-width:900px) {
    nav { padding:0 1rem; }
    .nav-inner { height:56px; }
    main { padding:1.5rem 1rem; }
    .cards { grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:1rem; }
    table { font-size:0.82rem; }
    th, td { padding:0.6rem 0.5rem; }
}

/* Mobile (<=640px) */
@media(max-width:640px) {
    .nav-toggle { display:flex; }
    .nav-links { display:none; position:absolute; top:56px; left:0; right:0; background:var(--bg-card); border-bottom:1px solid var(--border); flex-direction:column; padding:1rem; gap:0.2rem; z-index:99; }
    .nav-links.open { display:flex; }
    .nav-links a { padding:0.7rem 1rem; border-radius:8px; width:100%; text-align:right; }
    .nav-links a:hover { background:var(--bg); }
    .nav-links form { width:100%; }
    .nav-links form button.btn-nav { width:100%; text-align:right; padding:0.7rem 1rem; border-radius:8px; display:block; }
    .theme-toggle { margin:0.3rem 1rem; }
    body.light .nav-links { background:var(--bg-card); }

    main { padding:1.2rem 0.8rem; }
    .cards { grid-template-columns:1fr; gap:0.8rem; }
    .card { padding:1.5rem 1.2rem; }

    .flash-msg, .alert { font-size:0.8rem; padding:0.7rem 1rem; border-radius:10px; }

    table { font-size:0.78rem; }
    th, td { padding:0.5rem 0.4rem; }

    .modal { margin:0.5rem; padding:1.2rem; max-height:95vh; }
    .modal-header h3 { font-size:1.1rem; }

    footer { padding:1rem; }
    .footer-brand { font-size:0.75rem; }
    .footer-copy { font-size:0.65rem; }
}

/* Small phones (<=400px) */
@media(max-width:400px) {
    .logo-text { font-size:0.95rem; }
    .tenant-name { font-size:0.65rem; }
    main { padding:1rem 0.6rem; }
    .card { padding:1.2rem 1rem; }
    .card h3 { font-size:1rem; }
}
