@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #000000;
    --card-bg: rgba(25, 25, 25, 0.6);
    --card-border: rgba(255, 255, 255, 0.06);
    --accent: #f59e0b; /* Vivid Orange/Amber */
    --accent-glow: rgba(245, 158, 11, 0.25);
    --text-main: #ffffff;
    --text-hint: #a1a1aa;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --glass-blur: blur(16px);
    --font-main: 'Outfit', sans-serif;
}

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

body {
    background-color: #0a0500;
    background-image: 
        radial-gradient(ellipse 80% 60% at 0% 0%, rgba(245, 120, 10, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(180, 60, 0, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
        linear-gradient(160deg, #120800 0%, #050300 40%, #000000 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 32px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cards & Glassmorphism */
.glass {
    background: rgba(18, 18, 18, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card {
    padding: 24px;
}

.glass:hover {
    border-color: rgba(245, 158, 11, 0.15);
    box-shadow: 0 16px 48px rgba(0,0,0,0.7), 0 0 24px rgba(245, 158, 11, 0.06), inset 0 1px 0 rgba(255,255,255,0.06);
    transform: translateY(-1px);
}

/* Typography */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hint {
    color: var(--text-hint);
    font-size: 14px;
    font-weight: 400;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    appearance: none;
    -webkit-appearance: none;
}

.btn:hover:not(.primary):not(.danger):not(.success) {
    background: rgba(255, 255, 255, 0.1);
}

.btn.primary {
    background: var(--accent);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn.primary:hover {
    background: #d97706; /* Darker Orange */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn.secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
}

.btn.secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn.danger:hover {
    background: var(--danger);
    color: white;
}

/* Grid System */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Form Elements */
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-hint);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input, select, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

/* Table Design */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-hint);
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
}

td {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

td:first-child {
    border-left: 1px solid var(--card-border);
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

td:last-child {
    border-right: 1px solid var(--card-border);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.level-info { background: rgba(245, 158, 11, 0.1); color: #fbbf24; border-color: rgba(245, 158, 11, 0.2); }
.level-success { background: rgba(16, 185, 129, 0.1); color: #34d399; border-color: rgba(16, 185, 129, 0.2); }

/* Custom Utilities */
.dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}
.dot.on { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.dot.off { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* Layout Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    flex-shrink: 0; /* Sıkışmayı engeller */
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 32px 16px;
    border-radius: 0; 
    border-right: 1px solid var(--card-border);
    z-index: 100;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 12px 40px 12px;
}

.sidebar-brand--mark {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 32px;
}

.sidebar-logo-img {
    display: block;
    width: 100%;
    max-width: 188px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    object-position: left center;
}

.sidebar-brand .logo {
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-text .title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.brand-text .subtitle {
    font-size: 11px;
    color: var(--text-hint);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 10px; }

.nav-item {
    padding: 14px 16px;
    border-radius: 14px;
    color: var(--text-hint);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s;
    font-weight: 500;
    margin-bottom: 6px;
    cursor: pointer;
    background: transparent;
    border: 1px solid transparent;
    width: 100%;
    text-align: left;
}

.nav-item i {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-item-btn {
    justify-content: flex-start;
}

.nav-item .chevron {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s;
}

.nav-item.open .chevron {
    transform: rotate(180deg);
}

.nav-sub {
    padding: 10px 16px 10px 40px;
    font-size: 13px;
    color: var(--text-hint);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    transition: all 0.2s;
}

.nav-sub:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.03);
}

.sidebar-footer {
    margin-top: 24px;
    padding: 24px 12px 0 12px;
    border-top: 1px solid var(--card-border);
}

.tenant-pill {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    display: block;
    border: 1px solid var(--card-border);
}

/* Main Content Area */
.main {
    flex: 1;
    min-width: 0; /* Flexbox içinde taşmayı önler */
    padding: 40px;
    overflow-x: hidden;
}

.main-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.page-title .kicker {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.page-title .h {
    font-size: 32px;
    font-weight: 800;
}

/* Form Styles Extension */
.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== DEEP FORM OVERRIDES ===== */

/* Force dark background on ALL native inputs */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(10, 10, 10, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15) !important;
}

select option {
    background-color: #1a1a1a;
    color: #ffffff;
}

/* Select arrow override */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 36px !important;
}

/* Checkbox */
input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: var(--accent);
    border-radius: 4px;
    cursor: pointer;
    padding: 0 !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    background: rgba(10,10,10,0.8) !important;
}

/* Toggle / Check label */
.check {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-hint);
    font-weight: 500;
    padding: 6px 0;
}

.check:hover { color: var(--text-main); }

/* "Aç / Kapat" text buttons (usually <button> inside accordion-style cells) */
button.btn.small, a.btn.small {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 8px;
}

/* Remove white button defaults */
button {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* Accordion / collapse trigger buttons within forms */
details > summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    color: var(--text-hint);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}
details > summary:hover { background: rgba(255,255,255,0.06); color: var(--text-main); }
details[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-color: var(--accent); color: var(--text-main); }

details > .details-body {
    background: rgba(10,10,10,0.5);
    border: 1px solid rgba(255,255,255,0.07);
    border-top: none;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 16px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.3); }

/* ===== ERROR MESSAGES ===== */
.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
}

.success-banner {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #6ee7b7;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
}

/* ===== LINKS ===== */
a { color: inherit; }
a:hover { color: var(--accent); }

/* ===== UTILITY ===== */
.mr-1 { margin-right: 6px; }
.success { color: var(--success); }
.danger  { color: var(--danger); }
.warn    { color: var(--warning); }

code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

/* ===== CHAT LIST (Rules Page) ===== */
.chat-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    margin-top: 8px;
    background: rgba(0,0,0,0.3);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.1);
}

.chat-item input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px !important;
    height: 16px !important;
}

.chat-item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.chat-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== ACCORDION SECTION BOXES ===== */
.section-box {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 12px;
}

.section-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255,255,255,0.02);
    cursor: pointer;
}

.section-box-header:hover {
    background: rgba(255,255,255,0.04);
}

.section-box-body {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.05);
    background: rgba(0,0,0,0.2);
}

/* ===== BTN SMALL FIX ===== */
.btn.small, .btn.btn.small {
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn.small:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
}

.btn.small.danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn.small.danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn.success:hover {
    background: var(--success);
    color: #000;
    border-color: var(--success);
}

/* ===== LIMIT BADGE ===== */
.limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    color: #fbbf24;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* ===== AUTH (login / register) — ortalanmış, tek sütun form ===== */
.auth-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px 48px;
    box-sizing: border-box;
}

.auth-brand {
    text-align: center;
    margin-bottom: 8px;
    max-width: 420px;
}

.auth-logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-logo-img {
    display: block;
    width: auto;
    max-width: min(260px, 88vw);
    height: auto;
    max-height: 44px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
}

.auth-subtitle {
    margin-top: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-hint);
}

.auth-layout .glass.card {
    width: 100%;
    max-width: 420px;
    padding: 28px 26px 24px;
    margin: 0;
}

/* Eski şablonlarda .row tek alan için 2 kolon açıyordu; auth’ta tam genişlik */
.auth-layout .row {
    grid-template-columns: 1fr;
    gap: 0;
}

.auth-layout .field label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-hint);
    margin-bottom: 8px;
    display: block;
}

.auth-layout .glass:hover {
    transform: none;
}
