/* ================================================================
   Panel Admina — Custom CSS
   Bootstrap 4 compatible, wzorowany na login_panel/layouts/admin.php
   ================================================================ */

:root {
    --sidebar-width: 250px;
    --topbar-height: 60px;
    --primary-color: #3498db;
    --sidebar-bg: #2c3e50;
    --sidebar-hover: #34495e;
    --text-light: #ecf0f1;
    --text-muted-sidebar: #95a5a6;
    --content-bg: #f4f6f9;
}

/* ── BODY ── */
body.admin-body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--content-bg);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* ── TOP NAVBAR ── */
.admin-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.admin-topbar .hamburger-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #555;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.2s;
    margin-right: 8px;
}

.admin-topbar .hamburger-btn:hover {
    background: #f0f0f0;
}

.admin-topbar .topbar-brand {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
    white-space: nowrap;
}

.admin-topbar .topbar-brand:hover {
    text-decoration: none;
    color: var(--primary-color);
}

.admin-topbar .topbar-end {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.admin-topbar .topbar-end .btn {
    margin-left: 10px;
}

/* ── SIDEBAR ── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--text-light);
    transition: transform 0.3s;
    z-index: 1001;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.admin-sidebar::-webkit-scrollbar { width: 5px; }
.admin-sidebar::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 17px;
    font-weight: 600;
    flex-shrink: 0;
    color: var(--text-light);
    text-decoration: none;
}

.sidebar-brand:hover {
    color: var(--text-light);
    text-decoration: none;
}

.sidebar-brand i {
    margin-right: 8px;
    color: var(--primary-color);
}

.sidebar-nav {
    padding: 12px 0;
    flex: 1;
}

.sidebar-section-label {
    display: block;
    padding: 14px 20px 6px;
    color: var(--text-muted-sidebar);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(236, 240, 241, 0.85);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
    cursor: pointer;
}

.sidebar-link i {
    width: 20px;
    margin-right: 10px;
    font-size: 14px;
    text-align: center;
    opacity: 0.8;
    flex-shrink: 0;
}

.sidebar-link .toggle-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.2s;
    opacity: 0.7;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary-color);
    text-decoration: none;
}

.sidebar-link:hover i { opacity: 1; }

.sidebar-link.active {
    background: var(--sidebar-hover);
    border-left-color: var(--primary-color);
    color: #fff;
}

.sidebar-link.active i { opacity: 1; }

/* Treeview submenu */
.sidebar-submenu {
    display: none;
    background: rgba(0,0,0,0.12);
}

.sidebar-submenu.open { display: block; }

.sidebar-treeview.open .toggle-arrow {
    transform: rotate(-90deg);
}

.sidebar-submenu .sidebar-link {
    padding: 8px 20px 8px 46px;
    font-size: 13px;
}

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.sidebar-overlay.show { display: block; }

/* ── MAIN CONTENT ── */
.admin-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 28px;
    min-height: calc(100vh - var(--topbar-height));
    transition: margin-left 0.3s;
}

/* ── PAGE HEADER ── */
.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #2c3e50;
}

.page-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
}

/* ── BREADCRUMB ── */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 6px;
    font-size: 13px;
}

.breadcrumb-item a { color: var(--primary-color); }

/* ── CONTENT BOX ── */
.content-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.content-box-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
}

.content-box-title i {
    margin-right: 8px;
    opacity: 0.7;
}

/* ── INFO CARDS (dashboard) ── */
.info-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
}

.info-card .ic-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.info-card .ic-label {
    color: #7f8c8d;
    font-size: 13px;
    margin: 0;
}

.ic-blue   .ic-icon { background: rgba(52,152,219,0.12); color: #3498db; }
.ic-green  .ic-icon { background: rgba(39,174,96,0.12);  color: #27ae60; }
.ic-orange .ic-icon { background: rgba(230,126,34,0.12); color: #e67e22; }
.ic-red    .ic-icon { background: rgba(231,76,60,0.12);  color: #e74c3c; }
.ic-purple .ic-icon { background: rgba(155,89,182,0.12); color: #9b59b6; }
.ic-teal   .ic-icon { background: rgba(26,188,156,0.12); color: #1abc9c; }
.ic-dark   .ic-icon { background: rgba(44,62,80,0.10);   color: #2c3e50; }

/* ── WELCOME BANNER ── */
.welcome-banner {
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    color: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(52,152,219,0.25);
}

.welcome-banner h2 { font-size: 20px; margin-bottom: 6px; }
.welcome-banner p  { margin: 0; opacity: 0.85; font-size: 14px; }

/* ── TABLES ── */
.content-box .table { margin-bottom: 0; }

.table-panel thead th {
    border-top: none;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #555;
    background-color: #f8f9fa;
}

/* ── FORM STYLES ── */
.form-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.form-section-title i {
    margin-right: 7px;
    color: var(--primary-color);
}

/* ── FLASH MESSAGES ── */
.admin-flash { margin-bottom: 20px; }

/* ── LOGIN PAGE ── */
body.login-page-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.login-wrapper {
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-card .login-logo h1 {
    font-size: 26px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.login-card .login-logo p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.login-card .form-control {
    border-radius: 8px;
    padding: 11px 14px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.login-card .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.2);
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    padding: 12px;
    font-weight: 600;
    width: 100%;
    border-radius: 8px;
    font-size: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102,126,234,0.4);
    color: #fff;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.show { transform: translateX(0); }
    .admin-content { margin-left: 0; padding: 15px; }
    .admin-topbar .topbar-brand { margin-left: 0; font-size: 15px; }
}
