//* ==========================================================================
   SHADCN / UI ELEGANT CORPORATE DESIGN SYSTEM FOR PULSE ELEKTRİK
   Official Pure Zinc & Neutral Grey Palette - Zero Navy Tint
   ========================================================================== */

:root {
    --background: #f8fafc;
    --foreground: #09090b;
    
    --card: #ffffff;
    --card-foreground: #09090b;
    
    --popover: #ffffff;
    --popover-foreground: #09090b;
    
    --primary: #18181b;
    --primary-foreground: #fafafa;
    --primary-hover: #27272a;
    
    --secondary: #f4f4f5;
    --secondary-foreground: #18181b;
    --secondary-hover: #e4e4e7;
    
    --muted: #f4f4f5;
    --muted-foreground: #71717a;
    
    --accent: #f4f4f5;
    --accent-foreground: #09090b;

    --brand-blue: #2563eb;
    --brand-amber: #d97706;
    --brand-emerald: #059669;
    --brand-rose: #dc2626;
    
    --destructive: #dc2626;
    --destructive-foreground: #ffffff;
    --destructive-hover: #b91c1c;

    --border: #e4e4e7;
    --input: #e4e4e7;
    --ring: #18181b;
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;

    --admin-sidebar-width: 250px;
    --admin-sidebar-bg: #18181b;
    --admin-sidebar-text: #a1a1aa;
    
    --shadow-subtle: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
}

/* Dark Mode Pure Zinc Tokens Override */
.dark {
    --background: #09090b;
    --foreground: #fafafa;
    
    --card: #18181b;
    --card-foreground: #fafafa;
    
    --popover: #18181b;
    --popover-foreground: #fafafa;
    
    --primary: #fafafa;
    --primary-foreground: #18181b;
    --primary-hover: #e4e4e7;
    
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --secondary-hover: #3f3f46;
    
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    
    --accent: #27272a;
    --accent-foreground: #fafafa;

    --border: #27272a;
    --input: #27272a;
    --ring: #d4d4d8;

    --admin-sidebar-bg: #18181b;
}

/* Global Reset & Refined Shadcn Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.admin-body {
    background-color: var(--background);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--foreground);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Main Layout Structure */
.admin-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar Styles (Shadcn Dark Zinc Neutral) */
.admin-sidebar {
    width: var(--admin-sidebar-width);
    min-width: var(--admin-sidebar-width);
    max-width: var(--admin-sidebar-width);
    background: #18181b;
    color: #fafafa;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #27272a;
    position: relative;
    z-index: 20;
}

.sidebar-header {
    padding: 16px 14px;
    background: #09090b;
    border-bottom: 1px solid #27272a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-header img {
    height: 30px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.2);
}

/* Sidebar Workspace Segmented Control */
.sidebar-workspace-switcher {
    margin-top: 8px;
    display: flex;
    gap: 3px;
    background: #27272a;
    padding: 3px;
    border-radius: 6px;
    border: 1px solid #3f3f46;
    width: 100%;
}

.sidebar-workspace-btn {
    flex: 1;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    padding: 6px 4px;
    font-size: 0.72rem;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    color: #a1a1aa;
}

.sidebar-workspace-btn:hover {
    color: #ffffff;
    background: #3f3f46;
}

.sidebar-workspace-btn.active-cms {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

.sidebar-workspace-btn.active-op {
    background: #d97706 !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* Sidebar Navigation Items */
.sidebar-group-title {
    padding: 14px 16px 4px;
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #71717a;
    letter-spacing: 0.05em;
}

.sidebar-menu {
    list-style: none;
    padding: 4px 8px;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 2px;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: #a1a1aa;
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.sidebar-item a:hover {
    color: #fafafa;
    background: #27272a;
}

.sidebar-item.active a, .sidebar-item a.active {
    color: #ffffff;
    background: #27272a;
    border: 1px solid #3f3f46;
    font-weight: 500;
}

.sidebar-item a i {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
    opacity: 0.9;
}

/* Admin Main Area & Topbar */
.admin-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background-color: #f8fafc;
}

.dark .admin-main {
    background-color: #090d16;
}

.admin-topbar {
    background-color: #ffffff !important;
    color: #0f172a;
    min-height: 64px;
    height: 64px;
    padding: 0 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.dark .admin-topbar {
    background-color: #0f172a !important;
    color: #f8fafc;
    border-bottom-color: #1e293b !important;
}

.admin-topbar .page-breadcrumb {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.admin-topbar .page-breadcrumb i {
    color: var(--muted-foreground);
}

.admin-topbar .user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.82rem;
    background: var(--secondary);
    color: var(--secondary-foreground);
    padding: 5px 12px;
    border-radius: 9999px;
    border: 1px solid var(--border);
}

.admin-content {
    padding: 24px;
    flex-grow: 1;
    max-width: 1600px;
    width: 100%;
}

/* Page Header & Actions */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--muted-foreground);
    margin-top: 2px;
}

/* Shadcn UI Card Components */
.card {
    background: var(--card);
    color: var(--card-foreground);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-subtle);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 0.975rem;
    font-weight: 600;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Shadcn Stat Cards Grid */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: var(--shadow-subtle);
}

.stat-card .stat-lbl {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
    margin-bottom: 6px;
}

.stat-card .stat-val {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--foreground);
    letter-spacing: -0.02em;
}

.stat-card .stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.25rem;
    opacity: 0.6;
}

/* Shadcn UI Buttons */
/* High-Definition Solid Button System (Global) */
.btn,
button,
a.btn,
.btn-ui {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary, button[type="submit"].btn-primary, a.btn-primary {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25) !important;
}

.btn-primary:hover, button[type="submit"].btn-primary:hover, a.btn-primary:hover {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

.btn-danger, .btn-destructive, button.btn-danger {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.25) !important;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    color: #ffffff !important;
}

.btn-secondary, a.btn-secondary, button.btn-secondary {
    background-color: #f1f5f9 !important;
    color: #334155 !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.btn-secondary:hover, a.btn-secondary:hover {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border-color: #94a3b8 !important;
}

.btn-outline, a.btn-outline {
    background-color: var(--card) !important;
    color: var(--foreground) !important;
    border-color: var(--border) !important;
}

.btn-outline:hover {
    background-color: var(--secondary) !important;
}

.btn-destructive, a.btn-destructive {
    background-color: var(--destructive) !important;
    color: var(--destructive-foreground) !important;
    border-color: var(--destructive) !important;
}

.btn-destructive:hover {
    background-color: var(--destructive-hover) !important;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: 4px;
}

.btn-lg {
    padding: 10px 20px;
    font-size: 0.92rem;
    border-radius: var(--radius-md);
}

/* Shadcn Form Controls */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: 6px;
}

/* High-Definition Defined Form Controls (Global) */
.form-control,
.form-input,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
select,
textarea {
    width: 100%;
    height: 40px;
    padding: 8px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    color: #0f172a;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease-in-out;
    outline: none;
}

textarea.form-control,
textarea {
    height: auto !important;
    min-height: 80px;
}

.form-control:focus,
.form-input:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
    background-color: #ffffff !important;
}

/* Dark mode override for form controls */
.dark .form-control,
.dark .form-input,
.dark .form-select,
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="date"],
.dark input[type="time"],
.dark input[type="tel"],
.dark select,
.dark textarea {
    color: #fafafa;
    background-color: #09090b;
    border: 1.5px solid #3f3f46;
}

.dark .form-control:focus,
.dark .form-input:focus,
.dark .form-select:focus,
.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark input[type="password"]:focus,
.dark input[type="number"]:focus,
.dark input[type="date"]:focus,
.dark input[type="time"]:focus,
.dark input[type="tel"]:focus,
.dark select:focus,
.dark textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) !important;
}

/* Form Labels */
label, .form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.dark label, .dark .form-label {
    color: #fafafa;
}

/* Shadcn Clean Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--card);
}

.admin-table, table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.admin-table th, table.data-table th {
    background-color: var(--muted);
    padding: 10px 14px;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted-foreground);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table td, table.data-table td {
    padding: 10px 14px;
    font-weight: 400;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.admin-table tr:last-child td, table.data-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td, table.data-table tr:hover td {
    background-color: var(--secondary);
}

/* Shadcn Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
    border: 1px solid transparent;
}

.badge-success {
    background-color: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.badge-warning {
    background-color: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.badge-danger, .badge-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.badge-info, .badge-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
    border-color: var(--border);
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 400;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* Kanban Board Styling */
.kanban-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 14px;
}

.kanban-column {
    flex: 0 0 270px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.kanban-card {
    background: var(--card);
    color: var(--card-foreground);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    box-shadow: var(--shadow-subtle);
    transition: border-color 0.15s ease;
}

.kanban-card:hover {
    border-color: var(--primary);
}

/* Responsive Media Query for Mobile & Tablet */
@media (max-width: 991px) {
    .admin-sidebar {
        position: fixed;
        left: -250px;
        top: 0;
        bottom: 0;
        transition: left 0.25s ease;
        z-index: 1000;
    }

    .admin-sidebar.active {
        left: 0;
    }

    .admin-main {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .admin-topbar {
        padding: 0 10px !important;
        gap: 6px !important;
        justify-content: space-between !important;
    }

    .admin-content {
        padding: 12px !important;
    }

    .mobile-hide-text {
        display: none !important;
    }

    /* Force any multi-column grid splits (e.g. 2fr 1fr) to stack vertically 1 column on mobile */
    div[style*="grid-template-columns"],
    .grid {
        grid-template-columns: 1fr !important;
    }

    /* Horizontal scroll container for tables on small screens */
    table.admin-table,
    table.table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Form controls box sizing safety */
    .form-control, input, select, textarea {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}
