/* ============================================================
   Digital Obsidian & Slate Horizon — Global Design Standard
   VANILLA CSS FRAMEWORK (No Tailwind)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
    --bg-main: #0b1120;
    --bg-sidebar: #0f172a;
    --bg-topbar: rgba(15, 23, 42, 0.9);
    --bg-surface: rgba(30, 41, 59, 0.45);
    --bg-input: rgba(0, 0, 0, 0.3);

    /* Default - Electric Blue */
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);

    --text-main: #dae2fd;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --radius-xl: 16px;
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 4px;

    /* Font Weights Palette */
    --fw-light: 300;
    --fw-reg: 400;
    --fw-med: 500;
    --fw-bold: 700;
    --fw-extrabold: 800;
    --fw-black: 900;
}

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

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background 0.5s ease, color 0.3s ease;
}

/* ----------------------------------------------------------------
   Ana Yerleşim (Layout)
   ---------------------------------------------------------------- */
#app-sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
}

#app-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 280px;
    height: 72px;
    background: var(--bg-topbar);
    backdrop-filter: blur(32px);
    border-bottom: 1px solid var(--border);
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#page-content {
    margin-left: 280px;
    padding: 2.5rem;
    padding-top: calc(72px + 2.5rem);
    min-height: 100vh;
}

/* ----------------------------------------------------------------
   Sidebar Bileşenleri
   ---------------------------------------------------------------- */
.sidebar-logo {
    padding: 2.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.obs-logo {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.obs-logo .material-symbols-outlined {
    color: #fff;
    font-size: 24px;
}

.obs-title {
    font-size: 14px;
    font-weight: var(--fw-black);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.obs-tagline {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    opacity: 0.7;
}

#sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    transform: translateX(5px);
}

.nav-active {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ----------------------------------------------------------------
   Topbar Bileşenleri
   ---------------------------------------------------------------- */
.topbar-title {
    font-size: 1.25rem;
    font-weight: var(--fw-black);
    color: #fff;
    letter-spacing: -0.01em;
    text-transform: uppercase;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.pulse-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #0f172a;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

.profile-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-left: 1.5rem;
    border-left: 1px solid var(--border);
}

.profile-text p:first-child {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.profile-text p:last-child {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    opacity: 0.3;
}

.profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
}

/* ----------------------------------------------------------------
   PROFESYONEL BİLEŞENLER (STANDARDIZED)
   ---------------------------------------------------------------- */
.obs-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2.5rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
    position: relative;
}

.obs-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
}

.obs-btn {
    height: 52px;
    padding: 0 2.25rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: var(--fw-black);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.obs-btn:hover {
    background: #3b82f6;
    filter: contrast(1.1);
    transform: translateY(-1px);
}

.obs-btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.obs-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

.obs-input {
    width: 100%;
    height: 48px;
    background: rgb(255 255 255 / 4%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 0 1.5rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

textarea.obs-input {
    height: auto;
    min-height: 120px;
    padding: 1.25rem 1.5rem;
    resize: none;
    line-height: 1.6;
}

.obs-input:focus {
    border-color: var(--primary);
    background: rgb(0 0 0 / 20%);

}

.obs-input::placeholder {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 13px;
}

/* PREMIUM COMBO BOX (Select) */
select.obs-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='20' viewBox='0 0 24 24' width='20' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
    cursor: pointer;
}

select.obs-input option {
    background: #0f172a;
    color: #fff;
    padding: 1rem;
    border: none;
}

/* SEARCH RESULTS DROPDOWN */
.search-results-floating {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    display: none;
}

.search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-item:hover {
    background: var(--primary);
    color: #fff;
}

.search-item p {
    font-size: 13px;
    font-weight: 700;
}

/* ----------------------------------------------------------------
   THEME DRAWER & PANELS
   ---------------------------------------------------------------- */
#theme-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border);
    z-index: 20000;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.5s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 80px rgba(0, 0, 0, 1);
}

#theme-drawer.open {
    transform: translateX(0) !important;
}

.theme-header {
    padding: 2.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.01);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 2.5rem;
}

.theme-item {
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.01);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
}

.theme-item.active {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}

.theme-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* COMPANY ASSIGNMENT STYLES */
.company-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 18px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.company-card:hover {
    transform: scale(1.01);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--primary);
}

.company-card .c-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.company-card .c-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-card .c-name {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.01em;
}

/* AVATAR STACK */
.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-stack .a-item {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    border: 2px solid var(--bg-surface);
    background: var(--bg-sidebar);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 900;
    color: #fff;
    margin-left: -10px;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
}

.avatar-stack .a-item:first-child {
    margin-left: 0;
}

.avatar-stack .a-item:hover {
    transform: translateY(-4px);
    z-index: 10;
}

.avatar-stack .a-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-stack .a-more {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.2);
}

/* TOAST BİLDİRİM */
.obs-toast {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 99999;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    min-width: 300px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.obs-toast-success {
    background: linear-gradient(135deg, #059669, #10b981);
}

.obs-toast-error {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.obs-toast-info {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

/* PAGINATION */
.obs-pagination {
    display: flex;
    gap: 6px;
}

.obs-pagination .p-btn {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.obs-pagination .p-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: rgba(37, 99, 235, 0.2);
}

.obs-pagination .p-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* TABLO STANDARDI (Fixable Structure) */
.table-panel {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.4);
}

.obs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.obs-table th {
    padding: 1.5rem;
    text-align: left;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--border);
}

.obs-table td {
    padding: 1.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    transition: background 0.2s;
}

.obs-table tr:last-child td {
    border-bottom: none;
}

.obs-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

/* ----------------------------------------------------------------
   DRAWER & MODAL FIX (Edit Pages)
   ---------------------------------------------------------------- */
#app-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 650px;
    max-width: 90%;
    background: #0f172a;
    border-left: 1px solid var(--border);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
}

#app-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    padding: 2.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-header h2 {
    font-size: 1.1rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.drawer-body {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.drawer-footer {
    padding: 2rem 2.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
}

/* PERMISSIONS PAGE FIX */
.obs-switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.obs-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.obs-switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: .4s;
    border-radius: 20px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.obs-switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

input:checked+.obs-switch-slider {
    background: var(--primary);
    border-color: var(--primary);
}

input:checked+.obs-switch-slider:before {
    transform: translateX(22px);
    background: #fff;
}

/* ----------------------------------------------------------------
   Utilities & Loading
   ---------------------------------------------------------------- */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.custom-scrollbar::-webkit-scrollbar {
    width: 5px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 1024px) {
    #app-sidebar {
        transform: translateX(-100%);
    }

    #app-topbar,
    #page-content {
        left: 0;
        margin-left: 0;
    }
}

/* DRAWER BACKDROP (Modern Glassmorphism) */
#drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 9999;
    transition: opacity 0.3s ease;
}

#drawer-backdrop.hidden {
    display: none;
}