/* ===========================================
   Pelates Management - Navy Theme
   =========================================== */

:root {
    /* Navy color palette */
    --navy-900: #0f1f3a;
    --navy-800: #1e3a5f;
    --navy-700: #2c4a73;
    --navy-600: #3a5a8a;
    --navy-500: #4a6ea1;
    --navy-100: #e8eef7;
    --navy-50:  #f4f7fb;

    /* Accent */
    --accent: #2563eb;
    --accent-hover: #1d4ed8;

    /* Status */
    --success: #059669;
    --success-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0891b2;
    --info-bg: #cffafe;

    /* Neutral */
    --gray-50:  #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow:    0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);

    --radius-sm: 4px;
    --radius:    8px;
    --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-100);
}

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

/* ===========================================
   LOGIN PAGE
   =========================================== */
.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-circle {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}

.login-logo h1 {
    margin: 0;
    color: var(--navy-900);
    font-size: 22px;
}

.login-logo p {
    margin: 5px 0 0;
    color: var(--gray-500);
    font-size: 14px;
}

.login-footer {
    text-align: center;
    color: rgba(255,255,255,0.6);
    margin-top: 20px;
    font-size: 12px;
}

/* ===========================================
   NAVBAR
   =========================================== */
.navbar {
    background: var(--navy-900);
    color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-inner {
    display: flex;
    align-items: center;
    padding: 0 24px;
    max-width: 1600px;
    margin: 0 auto;
    gap: 20px;
    height: 60px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
}

.navbar-brand:hover { text-decoration: none; }

.logo-circle-sm {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--navy-600), var(--navy-500));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.navbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    margin-left: 30px;
}

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.nav-link.active {
    background: var(--navy-700);
    color: white;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
}

.ico { display: inline-block; }

/* ===========================================
   MAIN CONTENT
   =========================================== */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    margin: 0;
    color: var(--navy-900);
    font-size: 24px;
}

.page-actions {
    display: flex;
    gap: 8px;
}

.site-footer {
    text-align: center;
    color: var(--gray-500);
    padding: 30px 20px;
    font-size: 13px;
}

/* ===========================================
   STATS CARDS
   =========================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 18px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--navy-800);
}

.stat-card.stat-success { border-color: var(--success); }
.stat-card.stat-warning { border-color: var(--warning); }
.stat-card.stat-danger  { border-color: var(--danger); }
.stat-card.stat-info    { border-color: var(--info); }

.stat-label {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--navy-900);
}

/* ===========================================
   SEARCH CARD (πάνω, λευκή κάρτα)
   =========================================== */
.search-card {
    background: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.search-card input[type="search"] {
    flex: 1;
    min-width: 0;
}

.search-card .btn {
    flex-shrink: 0;
}

/* ===========================================
   ACTION BAR (μπλε, με φίλτρα + bulk actions)
   =========================================== */
.action-bar {
    background: var(--navy-800);
    color: white;
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.action-bar-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-bar-section + .action-bar-section {
    border-left: 1px solid rgba(255,255,255,0.18);
    padding-left: 14px;
}

.action-bar .results-count {
    margin-left: auto;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
}

.bulk-info {
    color: white;
    font-size: 13px;
    font-weight: 500;
}

.bulk-info span {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    padding: 2px 9px;
    border-radius: 999px;
    font-weight: 700;
    margin-right: 4px;
}

/* Dark-themed selects (για το navy bar) */
.dark-select {
    width: auto;
    min-width: 160px;
    padding: 7px 30px 7px 12px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 13px;
    border-radius: var(--radius);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: all 0.15s;
}

.dark-select:hover {
    background-color: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.4);
}

.dark-select:focus {
    outline: 0;
    background-color: rgba(255,255,255,0.2);
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
    color: white;
}

.dark-select option {
    background: white;
    color: var(--gray-800);
}

/* Light buttons για navy bar */
.btn-light {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-light:hover {
    background: rgba(255,255,255,0.22);
    color: white;
    text-decoration: none;
}

.btn-light-primary {
    background: white;
    color: var(--navy-800);
    border-color: white;
    font-weight: 600;
}

.btn-light-primary:hover {
    background: var(--navy-100);
    color: var(--navy-900);
}

/* Mobile: στοιβάγουμε τα sections */
@media (max-width: 700px) {
    .action-bar-section + .action-bar-section {
        border-left: 0;
        padding-left: 0;
        border-top: 1px solid rgba(255,255,255,0.18);
        padding-top: 10px;
        margin-top: 4px;
        width: 100%;
    }
    .dark-select { width: 100%; min-width: 0; }
    .action-bar .results-count { margin-left: 0; width: 100%; }
}

/* ===========================================
   FORMS
   =========================================== */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="search"],
textarea, select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
    outline: 0;
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(46, 74, 115, 0.15);
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 13px;
}

.form-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.form-card h3 { margin-top: 0; color: var(--navy-900); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group-full { grid-column: 1 / -1; }

.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-200);
}

.radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-pill {
    cursor: pointer;
    user-select: none;
}

.radio-pill input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-pill span {
    display: inline-block;
    padding: 8px 16px;
    border: 1.5px solid var(--gray-300);
    border-radius: 999px;
    background: white;
    transition: all 0.15s;
    font-size: 13px;
}

.radio-pill input[type="radio"]:checked + span {
    background: var(--navy-800);
    color: white;
    border-color: var(--navy-800);
}

.radio-pill:hover span { border-color: var(--navy-600); }

.quick-renew {
    margin-top: 6px;
    font-size: 12px;
    color: var(--gray-500);
}

.quick-renew .link-btn { margin-left: 6px; }

.link-btn {
    background: none;
    border: 0;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    padding: 2px 4px;
    font-size: inherit;
    font-family: inherit;
}

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

/* ===========================================
   BUTTONS
   =========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    background: white;
    color: var(--gray-700);
    text-decoration: none;
    font-family: inherit;
    line-height: 1.2;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--navy-800);
    border-color: var(--navy-800);
    color: white;
}

.btn-primary:hover {
    background: var(--navy-900);
    border-color: var(--navy-900);
    color: white;
}

.btn-edit {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
    padding: 5px 10px;
    font-size: 13px;
}

.btn-edit:hover { background: #0e7490; color: white; }

.btn-delete {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    padding: 5px 10px;
    font-size: 13px;
}

.btn-delete:hover { background: #b91c1c; color: white; }

.btn-ghost {
    background: white;
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.btn-ghost:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===========================================
   TABLES
   =========================================== */
.table-wrap {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: auto;
    max-height: calc(100vh - 280px);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th {
    background: var(--navy-800);
    color: white;
    text-align: left;
    padding: 11px 12px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.data-table thead th .sort-link {
    color: white;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.data-table thead th .sort-link:hover { opacity: 0.85; }

.sort-arrow {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.9;
}

.data-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--navy-50); }

.text-right { text-align: right; }

.col-check { width: 36px; }
.col-actions { width: 110px; white-space: nowrap; }

.empty-state {
    text-align: center;
    color: var(--gray-400);
    padding: 40px !important;
    font-style: italic;
}

.muted { color: var(--gray-500); font-size: 13px; }

/* ===========================================
   BADGES
   =========================================== */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-domain  { background: #ddd6fe; color: #5b21b6; }
.badge-hosting { background: #bfdbfe; color: #1e40af; }
.badge-support { background: #fbcfe8; color: #9d174d; }

.badge-status-active   { background: var(--success-bg); color: var(--success); }
.badge-status-inactive { background: var(--gray-200);   color: var(--gray-600); }

.days-pill {
    display: inline-block;
    min-width: 50px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    text-align: center;
}

.days-expired  { background: var(--danger-bg);  color: var(--danger); }
.days-critical { background: #fed7aa;            color: #9a3412; }
.days-warning  { background: var(--warning-bg); color: #92400e; }
.days-ok       { background: var(--success-bg); color: var(--success); }

/* ===========================================
   ALERTS
   =========================================== */
.alert {
    padding: 11px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid;
}

.alert-error   { background: var(--danger-bg);  color: #7f1d1d;  border-color: var(--danger); }
.alert-success { background: var(--success-bg); color: #064e3b;  border-color: var(--success); }
.alert-info    { background: var(--info-bg);    color: #155e75;  border-color: var(--info); }

/* ===========================================
   EMAIL PAGE
   =========================================== */
.email-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 16px;
}

.email-recipients, .email-composer {
    background: white;
    padding: 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
    margin: 0;
    color: var(--navy-900);
    font-size: 16px;
}

.quick-groups {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12px;
}

.recipient-search {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.recipient-list {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}

.recipient-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    gap: 10px;
}

.recipient-item:hover { background: var(--navy-50); }
.recipient-item:last-child { border-bottom: 0; }

.recipient-item input[type="checkbox"] { flex-shrink: 0; }

.recipient-info { flex: 1; min-width: 0; }
.recipient-name { font-weight: 600; color: var(--gray-900); font-size: 13px; }
.recipient-meta { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

.template-select {
    width: auto;
    padding: 6px 10px;
    font-size: 13px;
}

.placeholder-help {
    background: var(--navy-50);
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--gray-700);
}

.tag {
    display: inline-block;
    background: white;
    border: 1px solid var(--navy-600);
    color: var(--navy-700);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin: 2px;
    font-family: monospace;
}

.tag:hover { background: var(--navy-100); }

/* ===========================================
   PAGINATION & MODAL
   =========================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--gray-600);
    font-size: 13px;
}

.modal {
    border: 0;
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
}

.modal::backdrop { background: rgba(0,0,0,0.5); }

.modal article { padding: 20px; }
.modal header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-close {
    background: none;
    border: 0;
    font-size: 20px;
    cursor: pointer;
    color: var(--gray-500);
}

.email-body {
    background: var(--gray-50);
    padding: 14px;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 13px;
    max-height: 400px;
    overflow-y: auto;
}

/* ===========================================
   SETTINGS
   =========================================== */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
}

code {
    background: var(--gray-100);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--navy-800);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 900px) {
    .navbar-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 16px;
    }
    .navbar-nav { width: 100%; margin-left: 0; overflow-x: auto; }
    .form-grid, .email-layout, .settings-grid { grid-template-columns: 1fr; }
    .main-content { padding: 16px; }
    .stat-value { font-size: 22px; }
}

@media (max-width: 600px) {
    .data-table { font-size: 12px; }
    .data-table thead th, .data-table tbody td { padding: 7px 8px; }
    .col-actions { width: auto; }
    .page-header h1 { font-size: 20px; }
}