/* public/assets/css/style.css */

/* --- Core Design Variables & Tokens --- */
:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Color Palette */
    --primary: #0f172a;        /* Deep Slate / Navy */
    --primary-hover: #1e293b;
    --primary-light: #f8fafc;
    --accent: #0284c7;         /* Sky Blue */
    --accent-hover: #0369a1;
    --accent-light: #e0f2fe;
    
    --bg-main: #f8fafc;        /* Slate 50 */
    --bg-card: #ffffff;
    --border: #e2e8f0;         /* Slate 200 */
    --border-hover: #cbd5e1;   /* Slate 300 */
    
    /* Text Colors */
    --text-primary: #0f172a;   /* Slate 900 */
    --text-secondary: #334155; /* Slate 700 */
    --text-muted: #64748b;     /* Slate 500 */
    --text-light: #94a3b8;     /* Slate 400 */
    
    /* Semantic Colors */
    --success: #10b981;        /* Emerald 500 */
    --success-light: #ecfdf5;
    --warning: #f59e0b;        /* Amber 500 */
    --warning-light: #fffbeb;
    --danger: #ef4444;         /* Red 500 */
    --danger-light: #fef2f2;
    --info: #3b82f6;           /* Blue 500 */
    --info-light: #eff6ff;

    /* Shadow & Radius Tokens */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Resets --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-secondary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* --- Typography Helpers --- */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.25;
}

/* --- Layout Wrappers --- */
.app-container {
    display: flex;
    min-h: 100vh;
    min-height: 100vh;
}

/* --- Common Components: Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-secondary {
    background-color: #ffffff;
    color: var(--text-secondary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background-color: var(--primary-light);
    border-color: var(--border-hover);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}
.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    display: flex;
    width: 100%;
}

/* --- Common Components: Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-control::placeholder {
    color: var(--text-light);
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.checkbox-input {
    margin-right: 0.5rem;
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
}

/* --- Common Components: Cards --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Common Components: Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

/* --- Common Components: Alert / Callouts --- */
.alert {
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.15);
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.15);
}

/* --- Login Page Structure (Split Screen) --- */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.login-left {
    flex: 1.2;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4rem;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-brand h2 {
    color: #ffffff;
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.login-brand-icon {
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--accent);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-hero {
    max-width: 480px;
    margin: auto 0;
    z-index: 10;
}

.login-hero h1 {
    color: #ffffff;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.login-hero p {
    color: var(--text-light);
    font-size: 1.125rem;
    line-height: 1.6;
}

.login-left-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    z-index: 10;
}

.login-footer-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.login-footer-item svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--accent);
}

.login-right {
    flex: 1;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 2.25rem;
}

.login-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.forgot-password {
    font-size: 0.8125rem;
    font-weight: 500;
}

/* --- Dashboard Panel Layout --- */
.sidebar {
    width: 260px;
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-logo-icon {
    width: 1.875rem;
    height: 1.875rem;
    background-color: var(--accent);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-menu-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.75rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu-item {
    margin-bottom: 0.25rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.sidebar-menu-link svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: var(--transition);
}

.sidebar-menu-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu-link.active {
    color: #ffffff;
    background-color: var(--accent);
}

.sidebar-menu-link.active svg {
    color: #ffffff;
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background-color: rgba(0, 0, 0, 0.15);
}

.sidebar-org-info {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.sidebar-user-name {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Panel Right Side --- */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.navbar {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    margin-right: 1rem;
}

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

.nav-user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-avatar {
    width: 2.25rem;
    height: 2.25rem;
    background-color: var(--accent-light);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
}

.nav-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.logout-btn:hover {
    color: var(--danger);
    background-color: var(--danger-light);
}

/* --- Content Layout --- */
.content-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.breadcrumb-item::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-light);
}

.breadcrumb-item:last-child::after {
    content: '';
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* --- Dashboard Grid Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background-color: var(--accent-light);
}

.stat-card.danger .stat-icon {
    color: var(--danger);
    background-color: var(--danger-light);
}

.stat-card.success .stat-icon {
    color: var(--success);
    background-color: var(--success-light);
}

.stat-card.warning .stat-icon {
    color: var(--warning);
    background-color: var(--warning-light);
}

/* --- Grid Layouts --- */
.grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .grid-main {
        grid-template-columns: 1fr;
    }
}

/* --- Tables --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
}

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

.table th {
    background-color: var(--primary-light);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    vertical-align: middle;
}

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

.table tr:hover td {
    background-color: var(--primary-light);
}

/* --- Logs / Timeline Lists --- */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.activity-item {
    display: flex;
    gap: 1rem;
    position: relative;
}

.activity-badge {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.activity-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* --- Error Pages Styles --- */
.error-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background-color: var(--bg-main);
    font-family: var(--font-sans);
    padding: 1.5rem;
}

.error-container {
    max-width: 440px;
    width: 100%;
    text-align: center;
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 2rem;
}

.error-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.error-icon svg {
    width: 2rem;
    height: 2rem;
}

.danger-icon {
    background-color: var(--danger-light);
    color: var(--danger);
}

.info-icon {
    background-color: var(--accent-light);
    color: var(--accent);
}

.error-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.error-subtitle {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.error-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .login-left {
        display: none; /* Hide left side of login on tablet/mobile */
    }
    
    .login-right {
        flex: 1;
        padding: 2rem 1.5rem;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .navbar {
        padding: 0 1rem;
    }
    
    .content-body {
        padding: 1.25rem;
    }
    
    .breadcrumb-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
}

/* Placeholder Empty View Styling */
.placeholder-view {
    text-align: center;
    padding: 4rem 2rem;
    background-color: #ffffff;
    border: 1px dashed var(--border-hover);
    border-radius: var(--radius-lg);
}

.placeholder-icon {
    width: 4rem;
    height: 4rem;
    background-color: var(--primary-light);
    color: var(--text-muted);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
}

.placeholder-icon svg {
    width: 2rem;
    height: 2rem;
}

.placeholder-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.placeholder-desc {
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 1.5rem auto;
    font-size: 0.875rem;
}
