/* Premium EdTech CRM Design System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Indigo, Mint, Slate */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Light Theme (Default) */
    --bg-app: #f4f6f9;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-sidebar: #001952;
    --bg-sidebar-hover: #002884;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-sidebar: #94a3b8;
    --text-sidebar-active: #ffffff;
    --accent: #4f46e5;
    /* Royal Indigo */
    --accent-hover: #4338ca;
    --success: #0d9488;
    /* Mint Teal */
    --warning: #d97706;
    /* Amber */
    --danger: #e11d48;
    /* Coral Red */
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --sidebar-width: 260px;
    --glass-blur: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Dark Theme Override */
    --bg-app: #090d16;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-sidebar: #0b0f19;
    --bg-sidebar-hover: #1f2937;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-sidebar: #9ca3af;
    --text-sidebar-active: #ffffff;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --border: #1f2937;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
}

/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: var(--transition);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

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

/* Sidebar navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    background-image: radial-gradient(circle at 15% 50%, #002884, #001242);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
    font-weight: 700;
    font-size: 20px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.sidebar-logo span {
    color: var(--accent);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.sidebar-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-item a:hover {
    background-color: var(--bg-sidebar-hover);
    color: #ffffff;
}

.sidebar-item.active a {
    background-color: var(--accent);
    color: var(--text-sidebar-active);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--success));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.user-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: capitalize;
}

/* Main Content Workspace */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 70px;
    background-color: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: var(--transition);
}

.page-title {
    font-size: 20px;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle,
.notifications-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover,
.notifications-btn:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

.content-body {
    padding: 32px;
    flex-grow: 1;
}

/* Cards & Glassmorphism widgets */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.crm-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.crm-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.crm-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    /* background-color: var(--accent); */
}

.crm-card.success::before {
    background-color: var(--success);
}

.crm-card.warning::before {
    background-color: var(--warning);
}

.crm-card.danger::before {
    background-color: var(--danger);
}

.card-title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
}

.card-trend {
    margin-top: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

/* Forms & Inputs styling */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Beautiful custom buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--accent-hover);
}

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

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #0b7a70;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #c9173c;
}

/* Custom Table Layout */
.table-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    overflow-x: auto;
    margin-bottom: 32px;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.crm-table th {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.crm-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

@media (min-width: 992px) {
    .crm-table {
        white-space: nowrap;
    }

    .crm-table th,
    .crm-table td {
        white-space: nowrap;
    }

    /* Specific alignments */
    .crm-table th:last-child,
    .crm-table td:last-child {
        text-align: right;
        width: 1%;
    }

    .crm-table td:last-child>div {
        justify-content: flex-end;
    }

    .crm-table td>div {
        white-space: nowrap;
    }
}

@media (max-width: 991px) {
    .crm-table thead {
        display: none;
    }

    .crm-table,
    .crm-table tbody,
    .crm-table tr,
    .crm-table td {
        display: block;
        width: 100%;
    }

    .crm-table tr {
        margin-bottom: 16px;
        background-color: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        overflow: hidden;
        padding: 4px;
    }

    .crm-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        text-align: left;
    }

    .crm-table td:last-child {
        border-bottom: none;
        background-color: rgba(0, 0, 0, 0.01);
        align-items: center;
    }

    .crm-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        margin-bottom: 8px;
    }
}

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

.crm-table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-info {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--accent);
}

.badge-success {
    background-color: rgba(13, 148, 136, 0.1);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(217, 119, 6, 0.1);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(225, 29, 72, 0.1);
    color: var(--danger);
}

/* Interactive Kanban Board for Deals */
.kanban-board {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 16px;
    min-height: 500px;
}

.kanban-column {
    flex: 0 0 280px;
    background-color: rgba(0, 0, 0, 0.015);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.kanban-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

.kanban-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    flex-grow: 1;
}

.kanban-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow);
    cursor: grab;
    transition: var(--transition);
}

.kanban-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.kanban-card-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
}

.kanban-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kanban-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-secondary);
}

/* Authenticated Portal / Login Form */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-logo span {
    color: var(--accent);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
    padding: 20px;
    overflow-y: auto;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.crm-modal {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: var(--transition);
    margin: auto;
}

.modal-backdrop.active .crm-modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

/* Verification Certificate Layout */
.certificate-frame {
    border: 10px solid var(--bg-sidebar);
    padding: 40px;
    background: #ffffff;
    color: #000000;
    max-width: 800px;
    margin: 40px auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.cert-logo {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
}

.cert-title {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    color: var(--accent);
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.cert-text {
    text-align: center;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.cert-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    font-size: 14px;
}

/* Simulator Outbound Logs Interface */
.simulator-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-top: 32px;
}

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

.sim-log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
}

.sim-log-item {
    background-color: var(--bg-app);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sim-log-item.whatsapp {
    border-left-color: var(--success);
}

.sim-log-item.email {
    border-left-color: var(--accent);
}

.sim-log-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}

.sim-log-body {
    font-size: 13px;
    font-family: monospace;
    white-space: pre-wrap;
    background: rgba(0, 0, 0, 0.03);
    padding: 6px 10px;
    border-radius: 4px;
}

/* UI Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.toggle-slider {
    background-color: var(--success);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

 / *   P a g i n a t i o n   S t y l e s   * /   . p a g i n a t i o n    {
               d i s p l a y :    f l e x ;
               p a d d i n g - l e f t :    0 ;
               l i s t - s t y l e :    n o n e ;
               j u s t i f y - c o n t e n t :    c e n t e r ;
               m a r g i n - t o p :    2 0 p x ;
       
}

   . p a g e - i t e m    {
               m a r g i n :    0   2 p x ;
       
}

   . p a g e - l i n k    {
               p o s i t i o n :    r e l a t i v e ;
               d i s p l a y :    b l o c k ;
               p a d d i n g :    0 . 5 r e m   0 . 7 5 r e m ;
               c o l o r :    v a r ( - - p r i m a r y ) ;
               b a c k g r o u n d - c o l o r :    v a r ( - - b g - c a r d ) ;
               b o r d e r :    1 p x   s o l i d   v a r ( - - b o r d e r ) ;
               b o r d e r - r a d i u s :    v a r ( - - r a d i u s - s m ) ;
               t e x t - d e c o r a t i o n :    n o n e ;
               t r a n s i t i o n :    a l l   0 . 2 s ;
               f o n t - s i z e :    1 3 p x ;
               f o n t - w e i g h t :    5 0 0 ;
       
}

   . p a g e - l i n k : h o v e r    {
               b a c k g r o u n d - c o l o r :    v a r ( - - p r i m a r y ) ;
               c o l o r :    # f f f ;
       
}

   . p a g e - i t e m . a c t i v e   . p a g e - l i n k    {
               b a c k g r o u n d - c o l o r :    v a r ( - - p r i m a r y ) ;
               c o l o r :    # f f f ;
               b o r d e r - c o l o r :    v a r ( - - p r i m a r y ) ;
       
}

   . p a g e - i t e m . d i s a b l e d   . p a g e - l i n k    {
               c o l o r :    v a r ( - - t e x t - s e c o n d a r y ) ;
               p o i n t e r - e v e n t s :    n o n e ;
               b a c k g r o u n d - c o l o r :    v a r ( - - b g - a p p ) ;
               b o r d e r - c o l o r :    v a r ( - - b o r d e r ) ;
       
}

         / *   B o o t s t r a p   P a g i n a t i o n   U t i l i t i e s   * /   . d - f l e x    {
       d i s p l a y :    f l e x ;
       
}

   . j u s t i f y - c o n t e n t - b e t w e e n    {
       j u s t i f y - c o n t e n t :    s p a c e - b e t w e e n ;
       
}

   . a l i g n - i t e m s - c e n t e r    {
       a l i g n - i t e m s :    c e n t e r ;
       
}

   . d - n o n e    {
       d i s p l a y :    n o n e ;
       
}

   @ m e d i a   ( m i n - w i d t h :   5 7 6 p x )    {
           . d - s m - f l e x    {
           d i s p l a y :    f l e x ;
           
    }

           . d - s m - n o n e    {
           d i s p l a y :    n o n e ;
           
    }

           . a l i g n - i t e m s - s m - c e n t e r    {
           a l i g n - i t e m s :    c e n t e r ;
           
    }

           . j u s t i f y - c o n t e n t - s m - b e t w e e n    {
           j u s t i f y - c o n t e n t :    s p a c e - b e t w e e n ;
           
    }

           . f l e x - s m - f i l l    {
           f l e x :    1   1   a u t o ;
           
    }

       
}

   . s m a l l    {
       f o n t - s i z e :    1 3 p x ;
       
}

   . t e x t - m u t e d    {
       c o l o r :    v a r ( - - t e x t - s e c o n d a r y ) ;
       
}

   . f w - s e m i b o l d    {
       f o n t - w e i g h t :    6 0 0 ;
       
}

       