:root {
    --primary-color: #0f172a; /* Slate Blue Deep */
    --accent-color: #c4b486; /* Champagne Gold */
    --accent-hover: #b5a477;
    --bg-dark: #020617;
    --card-bg: rgba(30, 41, 59, 0.4); /* Refined translucent slate */
    --glass-border: rgba(255, 255, 255, 0.08); /* Sophisticated thin border */
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow-deep: 0 20px 40px rgba(0,0,0,0.6);
    --shadow-hover: 0 30px 60px rgba(0,0,0,0.7);
    --radius: 20px; /* More modern curve */
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-up {
    animation: fadeUp 0.6s ease-out forwards;
}

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

.spin {
    display: inline-block;
    animation: rotate 1.5s linear infinite;
}

/* Global Fixes */
.law-crm-container {
    font-size: 15.5px;
}

.law-crm-container, 
.law-crm-container *:not(.dashicons), 
.loc-modal, 
.loc-modal *:not(.dashicons),
input, 
button, 
select:not(.dashicons), 
textarea {
    font-family: 'Cairo', sans-serif !important;
    box-sizing: border-box;
    margin: 0;
}

.dashicons {
    font-family: dashicons !important;
}

/* Scroll Management */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important; 
    height: 100%;
    background: var(--bg-dark);
}

body.admin-bar .law-crm-container {
    height: calc(100vh - 32px);
    top: 32px;
}

.law-crm-container {
    display: flex;
    background: var(--bg-dark);
    height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999999;
    direction: rtl;
    color: var(--text-main);
    overflow: hidden; 
}

/* Welcome Banner */
.loc-welcome-banner {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
}

.loc-welcome-banner::before {
    content: "\f231"; /* Justice icon placeholder */
    font-family: dashicons;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 120px;
    color: rgba(255,255,255,0.05);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 25px;
    position: relative;
    z-index: 2;
}

.banner-icon {
    font-size: 45px;
    width: 45px;
    height: 45px;
    color: #ffd700;
}

.banner-text h2 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: var(--white);
    font-weight: 800;
}

.banner-text p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.banner-date {
    background: rgba(255,255,255,0.1);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 1rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Sidebar - Borderless Glass */
.loc-sidebar {
    width: 270px;
    background: rgba(13, 17, 23, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-shrink: 0;
    z-index: 10;
}

.loc-logo {
    padding: 2.5rem 1.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    text-align: center;
    letter-spacing: 0.5px;
}

.loc-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.loc-nav li {
    padding: 0 1rem;
    margin-bottom: 8px;
    list-style: none;
}

.loc-nav a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    padding: 1rem 1.25rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

.loc-nav li.active a, .loc-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transform: translateX(-5px); /* Slide effect for RTL */
}

.loc-nav a .dashicons {
    font-size: 22px;
    width: 220x;
    height: 22px;
}

/* Main Content Area */
.loc-main-content {
    flex: 1;
    height: 100%;
    padding: 1rem 3.5rem; /* Reduced top padding */
    background: radial-gradient(circle at top right, #1c2128, #010409);
    overflow-y: auto;
}

/* Glass Card - Stable and Borderless */
.loc-glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-deep);
    margin-bottom: 2rem;
    transition: var(--transition);
    animation: fadeUp 0.6s ease-out backwards;
}

.loc-glass-card:hover {
    background: rgba(22, 27, 34, 0.8);
    box-shadow: var(--shadow-hover);
}

.loc-section-title {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 1.5rem; /* Reduced spacing within boxes */
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Borderless Tables */
.loc-table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* Gap between rows instead of borders */
    margin-top: -10px;
}

th {
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-weight: 600;
    text-align: right;
    padding: 1rem 1.5rem;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr {
    transition: var(--transition);
}

td {
    padding: 1.25rem 1.5rem;
    background: rgba(255,255,255,0.02);
    border: none;
}

td:first-child { border-radius: 0 14px 14px 0; }
td:last-child { border-radius: 14px 0 0 14px; }

tr:hover td {
    background: rgba(255,255,255,0.08);
}

/* Stats Grid - Horizontal Rail */
.loc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2.5rem; /* Large gaps to prevent overlapping */
    margin-bottom: 10rem; /* Massive gap (160px) to ensure absolute separation from cards below */
}

.loc-stat-card {
    background: var(--card-bg);
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-deep);
    transition: var(--transition);
    animation: fadeUp 0.6s ease-out backwards;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.loc-stat-card .stat-body {
    display: flex;
    flex-direction: column;
}

.loc-stat-card:hover {
    box-shadow: var(--shadow-hover);
}

.loc-stat-card .label {
    font-size: 1rem;
    color: var(--text-dim);
    font-weight: 600;
}

.loc-stat-card .val {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 4px;
}

.loc-stat-card .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* Premium Buttons */
.loc-btn {
    padding: 0.85rem 1.75rem;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.loc-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.loc-btn-primary { 
    background: linear-gradient(135deg, var(--accent-color), #a3946a); 
    color: #1e293b; /* Dark text on gold */
}

.loc-btn:not(.loc-btn-primary) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}

/* Toast System - Elite Coordination */
.loc-toast-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loc-toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border-right: 4px solid var(--accent-color);
    padding: 1.25rem 2rem;
    border-radius: 12px;
    color: var(--text-main);
    box-shadow: var(--shadow-deep);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    animation: slideInLeft 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    border: 1px solid var(--glass-border);
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.loc-toast.success { border-right-color: var(--success); }
.loc-toast.error { border-right-color: var(--danger); }
.loc-toast.info { border-right-color: var(--accent-color); }

/* Modal Refinement */
.loc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999999;
    display: none; /* Controlled by JS flex */
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loc-modal-content {
    background: linear-gradient(160deg, #0f172a, #020617);
    padding: 3rem;
    border-radius: 28px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    position: relative;
}

.loc-modal-content h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    font-weight: 800;
    color: var(--accent-color);
}

.loc-modal-content input, 
.loc-modal-content select, 
.loc-modal-content textarea {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    color: var(--text-main);
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.loc-modal-content input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255,255,255,0.06);
}

/* Scrollbar and Global Layout */
.loc-main-content {
    background: radial-gradient(circle at top right, #1e293b, #020617);
}
